Distinguish documents that have already been synced


I’m using couchbase lite on IOS and would like to mark some documents as synced. My use case may be simpler than a general case in the sense that the documents I’m concerned about will never be modified again.

I’ve had a look at the CBLReplication pushReplication object and noticed a pendingDocumentIDs prop, but I have the feeling that if the app boots offline, it holds the id of documents that have already been synced to the gateway till internet access is regained.

Is there a way to collect, whether offline or online, all the ids of the documents that haven’t been synced yet ? Or to tell, on a per document basis, wheter it has been synced yet or not ?

Many thanks for your help,


After investigating a little bit more, pendingDocumentIDs does seem to be the right way to go.

My problem is that when a document is created offline, the set doesn’t seem to be updated with the new documentID.

It looks like pendingDocumentIDs only updates its value if the replication has been started (and hasn’t stopped yet.) It should still work if it’s in the offline state, though.

If you’re using a non-continuous replication, then if you’re offline it’ll stop almost immediately and you’ll have this problem. You could use a continuous replication as a workaround.

I’ve filed a bug report because we should make this property work reliably whether or not the replication is running.

Is it possible to get pendingDocumentIDs from the REST client (CBListener) on iOS?


Sorry, there’s no REST API for that yet.

Thanks for letting me know.