Check if replication is ready


#1

We are using Couchbase Lite 1.4 in our iOS App…
We need to know, when a replication is ready and all data is on the mobile device.

What is the best way to handle this?

We check the replicator status for != “active” on push and pull. But after this is the case, we still get a lot of “cblDatabaseChange” notifications :frowning:

So, how can we be sure, that everything on the mobile device is “in sync”?

Thanks
Stefan


#2

Start a one-shot (non-continuous) replication. When it stops, everything is up to date. (Unless it stopped with an error.)


#3

Just to clarify: If a single-shot replication Status.ActivityLevel been BUSY, but is no longer BUSY, then the replication is complete. I apologize if the symbol names are not quite right… I’m more familiar with the Java bindings. If the replication is continuous, then it is, sort of by definition, never “done”.