-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need a way to ensure the Realm instance on the sync client thread has been closed #5416
Comments
- Use SharedRealm::call_with_lock() to make sure deleteRealm and assetFile calls are process safe. - Also those calls will throw if the Realm instance on the sync client thread is still opened. - Disallow deleteRealm on a synced Realm file. See #5416 . - Manually delete SharedRealm pointer if the SharedRealm was created for callbacks, eg.: initialization_data_callback and migration_callback.
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? |
This was in 2017. How is this not yet resolved? What a joke this library is this if one can't even delete a file? |
Atlas Device Sync has been deprecated so it's probably best to find another product that does synchronization and allows file deletion 😊 |
SyncSessionStopPolicy::Immediately
is supposed to close the Realm instance on the sync client thread before theclose()
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.The text was updated successfully, but these errors were encountered: