You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app that is using local realms. It does happen that users take a break from the app and then come back. When dropping support for pre Realm 5.0.0 files, those users are out of luck. I know you can't bring backwards compatibility back, but right now it is not possible to detect that this error has happened on the Kotlin client whereas on iOS realm throws a specific error (Realm.Error.unsupportedFileFormatVersion) that at least allows developers to catch the error and provide a way for the user to reach out to support (or send the file to a server to convert it as suggested by @nirinchev in another github issue).
Solution
Right now this is all I can do is to check if we get an IllegalStateException then inspect the message to see if it is an unsupported file format version error. This is NOT something that should have to go into production code IMHO.
try {
val realm = Realm.open(configuration)
} catch (error:Exception){
if(error is IllegalStateException && error.message?.contains("RLM_ERR_UNSUPPORTED_FILE_FORMAT_VERSION") == true){
//Show dialog to reach out to support or use server function to upgrade database
}
}
Does the current API let me detect this in any other way? Is it safe to use this hack? Or are my returning customers screwed?
Alternatives
No response
How important is this improvement for you?
Dealbreaker
Feature would mainly be used with
Local Database only
The text was updated successfully, but these errors were encountered:
Problem
I have an app that is using local realms. It does happen that users take a break from the app and then come back. When dropping support for pre Realm 5.0.0 files, those users are out of luck. I know you can't bring backwards compatibility back, but right now it is not possible to detect that this error has happened on the Kotlin client whereas on iOS realm throws a specific error (Realm.Error.unsupportedFileFormatVersion) that at least allows developers to catch the error and provide a way for the user to reach out to support (or send the file to a server to convert it as suggested by @nirinchev in another github issue).
Solution
Right now this is all I can do is to check if we get an IllegalStateException then inspect the message to see if it is an unsupported file format version error. This is NOT something that should have to go into production code IMHO.
Does the current API let me detect this in any other way? Is it safe to use this hack? Or are my returning customers screwed?
Alternatives
No response
How important is this improvement for you?
Dealbreaker
Feature would mainly be used with
Local Database only
The text was updated successfully, but these errors were encountered: