We do not force clients in the wild to be up-to-date for Android. We have some clients running on 6-months old versions of the client-app (about 30 deploys behind).
More details about the situation.
- The client makes a request to the service to fetch a Realm database file.
- That Realm database file may have mismatching schemas as the clients.
- We do not send down SchemaMigrations to clients. It is part of the build for the client code right now.
- Once an old client gets the new realm database file, Realm.getInstance will throw an exception about mismatch schema, migration required
Since the Realm.getInstance throws an exception, I consider the client “broken” at this point.
One field is added to the model.
Older clients do not know about this schema change.
The realm file includes this property on the model (because it is delivered via an endpoint on a service).
The older client gets the realm file (note, not JSON, but a realm file).
The older client tries to get an instance of the realm file, but the schema does not match exactly (since there is a new field).
This leads to the older client getting throwing an exception during the getInstance
Just for clarification. The newer client will be fine and dandy because it will include the schema migration required to add the new field and read the database file correctly (woohoo). The problem is that old clients never get new code (because they don’t update the app, because they don’t want to?). I am hesitant of having the service send down a list of schema migrations alongside the schema because that can lead to many error cases (and the maintenance on that can get horrendous).