realm-java
realm-java copied to clipboard
Need a way to ensure the Realm instance on the sync client thread has been closed
SyncSessionStopPolicy::Immediately
is supposed to close the Realm instance on the sync client thread before the close()
call on the last Realm instance returned. But it seems it is not doing correctly.
This results:
-
Realm.deleteRealm()
cannot apply to synced Realm. -
RealmCache.doCreateRealmOrGetFromCache()
fordownloadRemoteChanges()
cannot clean the Realm file if the downloading failed.
Hey @beeender, will this issue be fixed soon? I currently have a login screen where the user logs into their Google account to sync all their data from Realm. If the user backs out of the login activity, I cancel the RealmAsyncTask which should close the Sync realm and delete the sync realm. I instead get a crash saying "It's not allowed to delete the file associated with an open Realm. Remember to close() all the instances of the Realm before deleting its file"
Hello everybody, is there an update on this issue? I'm currently observing this behavior on my Android 9 device.
➤ Brian Munkholm commented:
Closing as it's related to legacy sync.
This is still an issue as the same architecture is present in newer releases.
In 2023, this is still an issue. Will this be fixed?