-
Notifications
You must be signed in to change notification settings - Fork 577
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
Error Realm initialization with sync enabled due to mismatch schema is not calling onError function #6601
Comments
➤ PM Bot commented: Jira ticket: RJS-2794 |
@gfrancischini Thank you for reporting. I believe that we should extend |
We agree an error like this should signaled differently than calling
|
Hey any update on this issue? We are about to enter in homologation with our customer and we would like to be able to correctly log these errors to diagnose possible production problems |
Currently we are logging the errors to help customers to diagnose problems. To provide a better solution, we would like the customer to give us feedback on the four items in the previous comment. |
The RealmProvider could take an onError prop (admittedly, this name might be a little confusing as it conflicts with the onError passed through the sync config). I would call it Or maybe onMountError? but I still prefer the above We could throw when the useRealm (or any of our other hooks depending on it). |
I would expect developers to use an error boundary to handle these errors: Via |
I feel that error boundaries should be used when something unexpectedly happens. A schema error is a handled error and in my opinion, should be handled differently. What we know/is expected should be handled different from the unknow. But that is only my opinion really. So whatever solutions as long as we can show to our end user it is okay. What we cannot do is swallow the error as it is today as the app just crashes without giving user feedback |
I suppose the difference is if it's recoverable for the end-user or not 🤔 Some will be, others likely wont. I think this decision is the only thing holding back a fix for this. It's likely a simple change in code - and I'd like for us to get the API right 👍 |
We are also in need of a way to detect model schema mismatch, so that we can tell the user what corrective action they can take, instead of the app just crashing. Is there any planned fixed/change to allow us to detect this? |
has a decision been taken on this? at the moment this is a blocker for our project because if this happens the user will be |
How frequently does the bug occur?
Always
Description
Check the following line:
realm-js/packages/realm-react/src/RealmProvider.tsx
Line 140 in 91de944
It is calling the console.error directly. This way we cannot handle this error on user device.
We have configured the application to only open the realm for the first time after DownloadBeforeOpen.
Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
Version
realm@12.6.2
What services are you using?
Atlas Device Sync
Are you using encryption?
No
Platform OS and version(s)
Android/iOS All
Build environment
Which debugger for React Native: ..
Cocoapods version
No response
The text was updated successfully, but these errors were encountered: