Skip to content

Misleading docs on SyncManager pull() implementation #1698

@ddenev

Description

@ddenev

The current documentation on SyncManager's pull() method implementation says the following:

Image

The code example is misleading and contradicting the text above because:

  1. it uses lastFinishedSyncStart to limit the returned result set (i.e. the returned items will be different than the full data set for the collection) and
  2. it returns { items: data } which is expected to return the full data set for the collection (the SyncManager internally does a snapshot comparison to find the delta b/w the current collection and the returned collection)

Implementing the above example leads to SyncManager emptying the local collection after a 2nd sync when nothing has changed on the backend.

IMHO, the example should be updated to show both cases:

  1. when using the lastFinishedSyncStart to get only the changes (added, modified, removed) and then return { changes }
  2. when not using lastFinishedSyncStart to get all items in the collection and then return { items }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions