-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Add error boundry handling for Android #59385
[RNMobile] Add error boundry handling for Android #59385
Conversation
@@ -4,7 +4,6 @@ | |||
|
|||
import com.facebook.react.bridge.ReadableArray; | |||
import com.facebook.react.bridge.ReadableMap; | |||
import com.facebook.react.bridge.WritableMap; |
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.
I believe Android Studio removed this when it linted the file.
mGutenbergBridgeJS2Parent.logException(exception, logExceptionCallback); | ||
} | ||
|
||
private LogExceptionCallback onLogExceptionCallback(final Callback jsCallback) { |
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.
I'm following the same encapsulation used for other callbacks in the bridge, such as ConnectionStatusCallback
.
Flaky tests detected in a16c50f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8056529535
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
a16c50f
to
b61200e
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.
@jhnstn I took a brief look at the PR and shared some initial comments related to parsing the exception. Feel free to omit them in case you are already aware.
...bridge/src/main/java/org/wordpress/mobile/ReactNativeGutenbergBridge/GutenbergJsException.kt
Outdated
Show resolved
Hide resolved
...bridge/src/main/java/org/wordpress/mobile/ReactNativeGutenbergBridge/GutenbergJsException.kt
Outdated
Show resolved
Hide resolved
...bridge/src/main/java/org/wordpress/mobile/ReactNativeGutenbergBridge/GutenbergJsException.kt
Outdated
Show resolved
Hide resolved
...bridge/src/main/java/org/wordpress/mobile/ReactNativeGutenbergBridge/GutenbergJsException.kt
Outdated
Show resolved
Hide resolved
…-boundary/android
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@jhnstn the CI job
I think we are missing implementing UPDATE: Fixed in f3211da. |
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.
LGTM 🎊 !
* Add parse function to send exceptions over the RN bridge * Add RN bridge function to log exceptions to the host app * Add error boundary to blocks * Add error boundary at editor level * Log exceptions from error boundary components * Remove `in_app` stack trace parameter * Remove `getPopSize` The parameter `framesToPop` was dropped in RN version 0.62 (facebook/react-native@8bc02fd). * Simplify functions from `parseException` * Rename exception tag to `gutenberg_mobile_version` * Add `gutenbergDidRequestLogException` bridge function to demo app * Trigger callback upon sending JS exception * Format `RNReactNativeGutenbergBridge` * Update inline comments * Merge `reverseEntries` logic into `parseStacktrace` * Set second param of `parseException` (context and tags) as optional * Add unit tests of `parseException` * Add inline comment to `getReactNativeContext` * Add typing for JavaScript exception in bridge * Fix param type in `gutenbergDidRequestLogException` * Update `gutenbergDidRequestLogException` implementation of demo app * Rename `JSException` to avoid disambiguation with Crash Logging service * Add `actions` prop to `Warning` component * Allow extra styles in `Warning` component * Implement copy buttons in Error boundary component * Fix style import path in error boundary component * Change GutenbergJSException `function` param to non-optional * Rename JSException param to `message` * Rename GutenbergJSException param to `message` * Update `react-native-editor` changelog * Update unit tests of `parseException` * [RNMobile] Add error boundry handling for Android (#59385) * Add logException to Android bridge * Add logException to Android demo app * Add GutenbergJsException data class * Update logException to use data class and return bool to callback * integrate exception handling in the glue code * remove past tense 'did' * Refactor exception processing * lint * Add `logException` bridge function in demo app * Update stacktrace parsing on Android --------- Co-authored-by: Carlos Garcia <fluiddot@gmail.com> --------- Co-authored-by: Jason Johnston <jhnstn@users.noreply.github.com>
…ress#59221) * Add parse function to send exceptions over the RN bridge * Add RN bridge function to log exceptions to the host app * Add error boundary to blocks * Add error boundary at editor level * Log exceptions from error boundary components * Remove `in_app` stack trace parameter * Remove `getPopSize` The parameter `framesToPop` was dropped in RN version 0.62 (facebook/react-native@8bc02fd). * Simplify functions from `parseException` * Rename exception tag to `gutenberg_mobile_version` * Add `gutenbergDidRequestLogException` bridge function to demo app * Trigger callback upon sending JS exception * Format `RNReactNativeGutenbergBridge` * Update inline comments * Merge `reverseEntries` logic into `parseStacktrace` * Set second param of `parseException` (context and tags) as optional * Add unit tests of `parseException` * Add inline comment to `getReactNativeContext` * Add typing for JavaScript exception in bridge * Fix param type in `gutenbergDidRequestLogException` * Update `gutenbergDidRequestLogException` implementation of demo app * Rename `JSException` to avoid disambiguation with Crash Logging service * Add `actions` prop to `Warning` component * Allow extra styles in `Warning` component * Implement copy buttons in Error boundary component * Fix style import path in error boundary component * Change GutenbergJSException `function` param to non-optional * Rename JSException param to `message` * Rename GutenbergJSException param to `message` * Update `react-native-editor` changelog * Update unit tests of `parseException` * [RNMobile] Add error boundry handling for Android (WordPress#59385) * Add logException to Android bridge * Add logException to Android demo app * Add GutenbergJsException data class * Update logException to use data class and return bool to callback * integrate exception handling in the glue code * remove past tense 'did' * Refactor exception processing * lint * Add `logException` bridge function in demo app * Update stacktrace parsing on Android --------- Co-authored-by: Carlos Garcia <fluiddot@gmail.com> --------- Co-authored-by: Jason Johnston <jhnstn@users.noreply.github.com>
What?
Adds Android support to #59221
Why?
How?
Testing Instructions
See #59221 for testing
Testing Instructions for Keyboard
Screenshots or screencast