-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[NO QA]Feature: Critical Error Handling #3527
[NO QA]Feature: Critical Error Handling #3527
Conversation
… logging @react-native-firebase/crashlytics does not work for web and desktop
Here's a sample content logged to the server on error:
Produced by Log.alert(errorMessage, 0, {error: error.message, errorInfo}, false); I've deliberately inserted new lines in the printout here, the log sent to the server is condensed as one line |
The error logs as "{}" in the log, probably because it's a special object Updated to pass the error message instead
The stack trace is not interesting as it just traces to the moment we call `Log.alert` in `logError` Also the `errorInfo` contains the actual stack from React
Updated As per my last commit messages, I've spotted some small issues
I'm done making any more updates, until the review passes |
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.
Such a great improvement! I added a few comments and some screenshots after testing
Thanks, |
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, leaving the final review to @Jag96
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.
Looks good and tests well 👍
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging in version: 1.0.68-5🚀
|
🚀 Deployed to production in version: 1.0.73-3🚀
|
@Jag96
Details
Created a new
ErrorBoundary
componentThis component can serve to warp the whole app, or specific parts like documented here: https://reactjs.org/docs/error-boundaries.html#where-to-place-error-boundaries
@react-native-firebase/crashlytics
is available only for iOS and Android so a platform specific component was created to handle the logging - Android and iOS would log to E.cash server and crashlytics, while desktop and web would log only to the E.cash server (Reference: invertase/react-native-firebase#1530)Wrapped the main component
Expensify
withErrorBoundary
For the moment we're not rendering fallback UI, but just log the error that crashed React to the server and crashlytics
Fixed Issues
Fixes #3339
Tests
To test this you can trigger an exception in the render method of some component
In my sample video (iOS screenshots section) I've changed
ReportScreen
to throw an error when a specific report is openedQA Steps
N/A
Tested On
I've verified the app starts and works on these platforms
Screenshots
Web
Mobile Web
Desktop
iOS
Screen.Recording.2021-06-10.at.23.20.01.mov
Android