Realm Sync Error Codes Documentation & Client Reset Best Practices

Hi,

I was facing a few Realm Sync error, notably 208 and 211. I was looking for some documentation on what each sync error code means, something similar to the old Realm Sync document here – https://docs.realm.io/sync/v/3.x/using-synced-realms/troubleshoot/errors.

My open questions -

  1. Most of the errors (208 and 211) are caused because a client reset is not performed. What is the right way to listen for sync errors and perform a client reset. In the old Realm sync I see we can add a handler on the SyncManager.shared object to liste for any sync errors. But for the MDB Realm I don’t see anything called SyncManager.shared.
  1. What is the right way to perform a client reset on iOS SDK? I see a MDB doc stating that Realm.deleteFiles(for: config) is the way to go. But I’m not 100% sure when to trigger this, which kind of boils down to saying how to listen for sync errors ie. point 1.

Thank you in advance :slight_smile:

1 Like

Hi Siddharth,

Regarding what the error codes mean, please refer to this post.

As for how to do a client reset in iOS, our team is still working on documenting this in the Advanced Guides sections of our iOS SDK documentation in a similar format to other SDKs such as Android. For now the only documentation we have on this for iOS is the doc you already found here.

Having said that, we do have a sample app which utilises an example of a Client Reset in iOS that might help you to reference. Please see link below.

Hope that helps!

Regards
Manny

2 Likes

Thank you for the example code and quick reply! The way to listen for sync errors now is to use app.syncManager.errorHandler.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.