-
Notifications
You must be signed in to change notification settings - Fork 572
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
feat(POC): add error boundary to withSuspense #10468
base: main
Are you sure you want to change the base?
Conversation
8b2502c
to
e4c485b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me. I would actually be in favor of testing and merging because I believe as it stands today these network errors are essentially unhandled and lead to render error that then bubble up to our app wide error boundary which essentially blanks out the whole screen with the unable to load screen. In an ideal world we have thoughtful error states everywhere but I still think this is better than where we are at now.
As far as testing I wonder if there is somewhere we can just arbitrarily throw an error, maybe in relay code when using the withSuspense hook, rather than messing with connecting local metaphysics and throwing for specific queries.
This has been discussed a bit more and I think we should merge this, it is an improvement on what happens today. |
This PR resolves PHIRE-1019 and PHIRE-1109
Description
Introduced the sentry error boundary component that we can use instead of the standard react one.
Benefits over the react one are that the errors go to sentry directly and if we want we can also add a sentry feedback button (if we want) for the user to describe what they encountered without too much lift its pretty much ready from their side.
The Sentry Error boundary is basically the same - provides an error boundary component with a fallback prop (it can be any component we want similar to what we do have in react)
More information for the errorBoundary can be found here
More information for the user feedback flow can be found here
For now the solution is not ideal (that's why I marked it as #DONOTMERGE) since it will display in the existing places that we do have the withSuspense function the spinner in case of error.
Happy to gather some feedback or ideas to understand how to proceed.
How to test
You can connect local metaphysics to eigen locally and throw an error from the query from any point that we do use the
withSuspense
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.