I recently had to roll back my database by a few hours. This removed from the database records that had already synced. These records now seem to be stuck in the __realm_sync database. Client devices that had these records sync can still see and edit them, but the changes do not sync back to the main database. New records created do seem to sync to the main database. I have terminated and restarted sync but to no avail.
Hi, rolling back the database is unfortunately not a supported action for device sync. The main issue is that the devices will exist and have knowledge of changes that were essentially rolled back. If / when this happens, the devices will connect and be rejected as they reference history that the server no longer knows about (since all of the history and metadata is stored in MongoDB). This client will then perform a client reset and it will be up to that logic to determine what happened https://www.mongodb.com/docs/atlas/app-services/sync/error-handling/client-resets/
I suspect one possible fix might be to have the client device do a full replace of the object (delete and re-insert it) which might trigger the sync to Atlas. That being said, it is hard to say exactly what is going on without more access to the internal metadata, but its worth again noting that rolling back the database is not a supported action at this time (though it should over time recover mostly and depends on the specific circumstances)
New & Unread Topics
Topic | Replies | Views | Activity |
---|---|---|---|
Sample code issue. Unresolved reference for MongoClient.create | 3 | 812 | May 2024 |
Using %stringToOid with an array | 2 | 462 | Jun 2024 |
Trigger fullDocumentBeforeChange doesn’t contain all fields | 0 | 217 | Aug 2024 |
unity androlid apk error | 0 | 185 | Aug 2024 |
Librealm_dart.dylib: No such file or directory | 3 | 296 | Aug 2024 |