eigen
eigen copied to clipboard
feat(POC): add error boundary to withSuspense #DONOTMERGE
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
- [x] I have tested my changes on iOS and Android.
- [x] I hid my changes behind a feature flag, or they don't need one.
- [x] I have included screenshots or videos, or I have not changed the UI.
- [x] I have added tests, or my changes don't require any.
- [x] I added an app state migration, or my changes do not require one.
- [x] I have documented any follow-up work that this PR will require, or it does not require any.
- [x] I have added a changelog entry below, or my changes do not require one.
To the reviewers 👀
- [ ] I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
- add error boundary to withSuspense - gkartalis
Need help with something? Have a look at our docs, or get in touch with us.
This PR contains the following changes:
- Dev changes (add error boundary to withSuspense - gkartalis)
Generated by :no_entry_sign: dangerJS against cbbcc42b6ac5a61f9a9dea58e650f43852390f4c
This has been discussed a bit more and I think we should merge this, it is an improvement on what happens today.
Looks like the tests are breaking 👀
yep @MounirDhahri I might need to rebase
thanks @gkartalis for looking into this.