1

We have an iOS application using Sync Gateway and Couchbase Server to synchronize data between our mobile clients.

Now we have a use case where we are syncing Documents, by specifying Channels to replicator configuration. This first sync works fine and we can see replicator total progress.

 Master Data Replicator total progress is : 2

 Master Data Replicator completed progress is: 2

 Master Data Replicator status  is currently : busy

 Master Data Replicator status currently : stopped

In second use case there is a scenario where we have option to delete everything and re-sync. To achieve this we are purging all the saved documents locally which is also working fine.

But, when we are calling replicator again using same channels in configuration, the documents aren't syncing again. The logs looks like below -:

 Master Data Replicator total progress is : 0

 Master Data Replicator completed progress is: 0

 Master Data Replicator status  is currently : busy

 Master Data Replicator status  currently : stopped

What I tried is if i set reset Checkpoint to true for start replicator call it starts to re-sync, but I'm not sure if that's correct way to re-sync the purged documents.

Can anyone suggest, what's the right solution to re-sync purged docs? The ReplicatorType for our configuration is set to .pull only.

Matthew Groves
  • 25,181
  • 9
  • 71
  • 121

1 Answers1

1

Couchbase Lite sends a checkpoint to server to get the documents to the device. Purging the documents in device do not reset this. Your intuition is right. If you reset the check point, the documents will re-sync to the device.