-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Description:
I am encountering a synchronization issue with deleted documents when one device is offline.
Scenario 1 (Online - Working): When Device A and Device B are both online with the Replicator active, deleting a document on Device A immediately deletes it on Device B. This works as expected.
Scenario 2 (Offline - Failing):
Both Device A and Device B have the same document.
Device B goes offline (App closed/killed).
I delete the document on Device A.
The deletion is synced to the server (checked on Couchbase Capella, the document is correctly deleted/marked as tombstone).
Device B comes online (App opened, Replicator starts).
Result: Device B still retrieves the deleted document via query. It seems the deletion event (tombstone) is not being pulled or processed correctly by Device B upon reconnection.
Steps to Reproduce:
-
Initialize cbl-reactnative on Device A and Device B. Connect both to the same Capella bucket.
-
Wait for all documents to sync to Device A and B.
-
Kill the app on Device B (simulate offline/inactive state).
-
Delete doc_1 on Device A.
-
Verify on Couchbase Capella dashboard that doc_1 is deleted.
-
Open the app on Device B. Wait for the Replicator to finish connecting.
-
Run a query on Device B to fetch doc_1.
Observed: doc_1 is still returned in the query results on Device B.
Expected: doc_1 should be removed from Device B's local database after the Replicator pulls the changes.
Environment Info:
Library Version: cbl-reactnative 0.6.3
React Native Version: 0.74.5
Platform: (iOS 18.3 / Simulator)
Server: Couchbase Capella
Replicator Config:
Type: PushAndPull
Continuous: true
Method use to delete document
await airportCollection.deleteDocument(document);
Source code:
DemoCBApp.zip
Video demo
https://drive.google.com/file/d/19ZHIl7wwbIugwfBSdsz5lghmjFLRCy9W/view?usp=sharing