-
Notifications
You must be signed in to change notification settings - Fork 585
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
[iOS] Client reset due to breaking schema change crashes until reinstall #4699
Comments
I fully understand that working with client reset is confusing. It is a feature which is still in active development, and we learn from our users on how to shape it. So thank you for sharing! The const mergedPublicConfig = {
path: 'public.realm',
schema: [Medication],
sync: {
user: currentRealmUser,
partitionValue: PUBLIC_PARTITION,
error: handlePublicRealmSyncError,
clientReset: {
mode: Realm.ClientResetMode.DiscardLocal,
clientResetBefore: realm => {
// NOT used with destructive schema changes
console.log('Beginning client reset for ', realm.path)
},
clientResetAfter: (beforeRealm, afterRealm) => {
// NOT used with destructive schema changes
console.log('Finished client reset for', beforeRealm.path)
console.log('New realm path', afterRealm.path)
},
},
newRealmFileBehavior: OpenImmediately,
existingRealmFileBehavior: OpenImmediately,
}
} |
@kneth sorry about that, our configuration is indeed correct as you described, but when posting the issue, I merged them manually to reduce the code block and made a mistake. The Edited the original post for clarity. Just to add on this is the console logged config:
|
From your description, it sounds like you are hitting the same issue as in realm/realm-core#5289. We haven't released the fix for hermes yet but it should come soon. |
@kneth Thank you for the update! I dislike asking for ETAs but just for this once, do you know when the next version of |
@thespacemanatee it's your lucky day, as we just released v11.0.0-rc.0. |
Amazing work guys, the issue seems to be (mostly) fixed. I induced a client reset by making a breaking change which still causes the app to crash indefinitely, but once I revert the schema change, it stopped crashing immediately and performed the client reset successfully. Is the incessant crashing on broken schema change expected? I would have expected the client reset to just fail gracefully. Nonetheless, this is a huge leap forward and thanks yall for the hard work. |
We are currently implementing new client reset modes (see #4711) which will make the client reset process more smooth. You might want to reach out to Technical Service as they will be able to look at both client and server side to provide better insights. |
@thespacemanatee Did you have any more feedback on this or can we close the ticket? |
I'm going to close this ticket for now but please feel free to re-open if you are still having issues |
How frequently does the bug occur?
All the time
Description
When a breaking schema change occurs, on iOS it crashes forever until we reinstall the application. On Android, it crashes if the app is running while a breaking schema change was made, but does not crash anymore after that.
The error name sent to Sentry is:
N5realm5_impl12client_reset17ClientResetFailedE
.We are following this official guide to do client reset. We use
discardLocal
for non-breaking schema changes and manually discard all unsynced changes during a breaking schema change.Stacktrace & log output
Console:
C++ Exception:
Can you reproduce the bug?
Yes, always
Reproduction Steps
Version
10.20.0.beta5
What SDK flavour are you using?
Atlas App Services (auth, functions, etc.)
Are you using encryption?
No, not using encryption
Platform OS and version(s)
All iOS versions
Build environment
No response
Cocoapods version
1.11.3
The text was updated successfully, but these errors were encountered: