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
[hermes] Realm.open throws error when checking if Realm exists #5235
Comments
Looking at the js_sync.hpp code, it should go into |
@bimusiek Thanks for reporting this. We will investigate. |
@takameyer Awesome, the fix for us was to change mode to
just to be sure it won't happen again. |
Default is currently |
I have opened #5288 but I don't think it solved it all. |
I will close the issue as the fix is working for us. Personaly I think that if there is default ClientResetMode that requires additional parameters, it should implement those by default. It would be unexpected to use Realm and get native error saying that onDiscard is not implemented, hard to understand as there is no stacktrace pointing it to ClientResetMode configuration. I only found the culprit because github found the error message in the native code and I figured it out. |
@bimusiek Yes, I agree the default mode shouldn't require any configuration. To be honest, we haven't settled on what the default callback should do - maybe |
As far as I understand the C++ code, the callbacks are simply called after Realm tried to recover or failed to recover and discarded the old one. Which means, why are those even required? I would either put default callbacks that do nothing or do not require those at all in the core. Console.warn is ok, but you will only see it when ClientReset happens, so hardly anyone will see it. From dev perspective, I can assume that default behaviour is RecoverOrDiscard with no callbacks and if I want to be notified in the runtime that this happened, then I will put my own Realm.Configuration with proper callbacks. |
How frequently does the bug occur?
Always
Description
When trying to open Realm, it throws error
on this line (bundled file thus the screenshot):
The config which we open the Realm with:
I have cut out the
schema
part as it was too long.I have tracked it to this line of code https://github.com/realm/realm-js/blob/master/src/js_sync.hpp#L1308
But I cannot find any documentation about it:
https://www.mongodb.com/docs/realm/sdk/node/examples/reset-a-client-realm/
There is neither mention of
onDiscard
noronRecovery
.Stacktrace & log output
No response
Can you reproduce the bug?
No
Reproduction Steps
No response
Version
11.3.0
What services are you using?
Atlas Device Sync
Are you using encryption?
No
Platform OS and version(s)
iOS 16.0.3 / React Native 0.70.6
Build environment
Which debugger for React Native: Flipper (hermes)
Cocoapods version
No response
The text was updated successfully, but these errors were encountered: