Hi all,
I’m porting a Swift iOS demo app from ROS to MongoDB Realm. I have an accounts collection and I initialize a notification handler as follows:
notificationToken = accounts.observe { [weak self] (changes) in
guard let accountsTableView = self?.accountsTableView else { return }
switch changes {
case .initial:
accountsTableView.reloadData()
case .update:
accountsTableView.reloadData()
case .error(let error):
// An error occurred while opening the Realm file on the background worker thread
fatalError("\(error)")
}
}
Then initial sync works and my tableview gets loaded with the list of expected accounts. However, if I make a change to an account in the MongoDb Collection, then I do not get the update syncing with my IOS app (a breakpoint on the “.update” case is not hit)?
If I restart the app the change comes though with the initial sync.
The Realm server logs do however show the following entry:
> OK
> Dec 02 8:27:55+00:00
> 49ms
> SyncWrite
–
[5fc7133ea9536f9ade3901ea]
Source:
Write originated from MongoDB
Logs:
[ “Upload message contained 1 changeset(s)”, “Integrating upload required conflict resolution to be performed on 0 of the changesets”, “Latest server version is now 12” ]
Partition:
5fc6497676312e5697784cbb
Write Summary:
{ “Account”: { “replaced”: [ “5fc4e76983e79e3471f8d3c7” ] } }
And my app logs show the following:
2020-12-02 08:27:24.554687+0000 mongodb-realm-offline-banking[91583:9949465] Sync: Connection[1]: Session[1]: client_reset_config = false, Realm exists = true, async open = false, client reset = false
2020-12-02 08:27:24.634948+0000 mongodb-realm-offline-banking[91583:9949452] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
2020-12-02 08:27:24.690874+0000 mongodb-realm-offline-banking[91583:9949465] Sync: Connection[1]: Connected to endpoint ‘3.210.32.164:443’ (from ‘192.168.1.141:62813’)
FWIW - The app was fully functioning with ROS. Obviously I’ve updated the SDK to the latest version in order to sync with MongoDB Realm, and the notification handler did not require any code changes.
Anyone have any ideas?