Check sync status

32 views
Skip to first unread message

Scott Ahten

unread,
Sep 9, 2015, 11:23:24 AM9/9/15
to Couchbase Mobile
Let's say I have device with a number of local changes to a CBL database. After some time passes, I want remove the database with these changes from the device. However, I only want to remove the database if the device had actually connected to the network and successfully synced all of those changes with the gateway during that time. Otherwise, this would result in data loss. 

What is the simplest way to determine if those changes have been synced?

Jens Alfke

unread,
Sep 9, 2015, 11:31:55 AM9/9/15
to mobile-c...@googlegroups.com

> On Sep 9, 2015, at 8:04 AM, Scott Ahten <lightand...@gmail.com> wrote:
>
> What is the simplest way to determine if those changes have been synced?

Check pushReplication.pendingDocumentIDs … if it’s non-empty, there are documents that haven’t been synced.

—Jens

Scott Ahten

unread,
Sep 9, 2015, 2:06:34 PM9/9/15
to Couchbase Mobile
Just what I was looking for. Thanks!
Reply all
Reply to author
Forward
0 new messages