I’m having problems understanding the concept of schema updates in the context of Atlas Device Synced Realm. The documentation doesn’t make it clear on what is the approach to migrate breaking changes. The only 2 options available are stated as:
- Partner collection
- Client reset
Partner collection is more for production environment - and even then I’d rather not have every breaking change to have a partner collection… 100 breaking changes = 100x write per collection? Ideally, I’d like to have a schema versioned so that my app can handle the migration on a breaking change… anyway I digress.
So I figured, option 2! Client reset each time there is a breaking change, so that the client will delete the local realm and sync up to the new schema… Nope this does not work at all. I’m currently sitting on this issue where I’ve reset the device sync service many times in App Services UI, but it is still giving me a non-descriptive error message below:
I/flutter ( 6870): [INFO] Realm: Connection[1]: Session[1]: client_reset_config = false, Realm exists = true, client reset = false
I/flutter ( 6870): [INFO] Realm: Connected to endpoint '52.64.157.195:443' (from '10.0.2.16:36396')
I/flutter ( 6870): [INFO] Realm: Verifying server SSL certificate using 155 root certificates
I/flutter ( 6870): [INFO] Realm: Connection[1]: Connected to app services with request id: "63ecb35db314827f0e6bfb8b"
I/flutter ( 6870): [INFO] Realm: Connection[1]: Session[1]: Received: ERROR "Invalid query (IDENT, QUERY): failed to parse query: query contains table not in schema: "UserQuery"" (error_code=226, try_again=false, error_action=ApplicationBug)
I tried to delete the realm manually during the error handling but to no avail:
syncErrorHandler: (syncError) {
log().d('syncErrorHandler : ${syncError.category} $syncError');
realm.close();
Realm.deleteRealm(realm.config.path);
},
Any assistance would be much appreciated thanks.
I’m currently using the Flutter Realm 1.0.0.