Skip to content

## README: filters.action is wrong — Sync API uses type #110

Description

@pithu

Package: @contentstack/datasync-manager v2.2.0 (README on main has the same issue)

Problem

The README documents init sync filters like this:

filters: {
  content_type_uid: ['blogs'],
  locale: ['en-us'],
  action: ['publish', 'unpublish']
}

That does not match the Sync API or what the manager actually sends.

What actually works

Per the Sync API docs, initial sync (init=true) uses the query param type, with values like entry_published, asset_published, entry_deleted, content_type_deleted, etc. — not publish / unpublish.

The manager forwards filter keys verbatim to the API (dist/core/index.js):

request.qs[filter] = filters[filter].join(',');

So action: ['publish'] becomes ?action=publish, which the Sync API does not support. A working config looks like:

filters: {
  type: ['entry_published', 'asset_published', 'entry_deleted', 'content_type_deleted']
}

Suggested fix

  • Replace action with type in the README.
  • Document Sync API event type values, not store method names (publish / unpublish / delete).
  • Note that filter keys are passed through as-is to Sync API query params.

We ran into this building an init sync that replays historical deletes via content_type_deleted. Happy to open a README PR if useful.

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