Skip to content

Sync function not working #303

Closed
Closed

Description

@danny-schoeter

I'am trying to use the sync function but I always got undefined as my return value.
While debugging I eventually saw that the returned object of the getData function does not match the expected AxiosResponse type but is actually the REST API response as defined in the documentation https://www.contentstack.com/docs/developers/apis/content-delivery-api#initial-sync
So, response.data is always undefined which also leads to a type error while evaluating the while statement when setting the recursive parameter to true

Uncaught TypeError: Cannot use 'in' operator to search for 'pagination_token' in undefined
Image

Activity

  1. nadeem-cs commented on Jan 29, 2026

    @nadeem-cs
    Contributor

    Thanks for the detailed explanation and for sharing your findings.

    You’re right that the sync API response does not follow the standard AxiosResponse structure, which leads to response.data being undefined and causes the error when recursive is set to true.

    We’ll be checking this on our end and will update the issue once we have more details.
    Thanks for bringing this to our attention 👍

  2. reeshika-h commented on Aug 5, 2026

    @reeshika-h
    Contributor

    @danny-schoeter Confirmed fixed by a later change to the sync implementation, which corrected the response typing/destructuring — synchronization() now types the getData result as the unwrapped sync response instead of an AxiosResponse, and checks pagination_token on the correct object. Recursive sync works as expected on current main. Closing — please reopen if you still hit this.
    cc: @netrajpatel @OMpawar-21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions