Skip to content
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

Client reset during async open may lead to a fatal error #6601

Closed
sync-by-unito bot opened this issue May 10, 2023 · 0 comments · Fixed by #6602
Closed

Client reset during async open may lead to a fatal error #6601

sync-by-unito bot opened this issue May 10, 2023 · 0 comments · Fixed by #6602

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented May 10, 2023

When a realm is opened asynchronously (Realm::get_synchronized_realm()), the new schema is set when download completes (as a result of RealmCoordinator::get_unbound_realm() being called). If the new schema contains extra tables, this can be a problem in case of a client reset.
There are two callbacks (notify_before_client_reset & notify_after_client_reset) in case of a client reset, which if set, are called with an instance of a frozen realm. The frozen realm is opened with the new schema, which fails validation if it not a subset of what actually exists:

'Unsupported schema changes were made by another client or process:

  • Class '<table_name>' has been removed.'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants