Skip to content
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

Add error boundary components and exception logging #6655

Merged
merged 32 commits into from
Mar 11, 2024
Merged

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Feb 20, 2024

Related PRs:

Closes #1187 (comment).

The changes coming from Gutenberg enable the error boundary at the editor and block level. As well as provide a bridge function to log JavaScript exceptions to the Crash Logging service used in the host apps.

Additionally, this PR includes the following changes:

  • Set a global error handler to log exceptions caused by unhandled errors.
  • Include the source map files as Buildkite artifacts. Previously, it was limited to jobs triggered by Git tags.
  • Include the source map files in iOS XCFramework so they can be uploaded to the Crash logging service to symbolicate the stack trace.

To test

Since it involves testing exceptions, we need to modify the code to force errors and generate an installable build. A test PR has been created for this purpose, follow the testing instructions from #6654.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes more info and have added them to RELEASE-NOTES.txt if necessary.

@fluiddot fluiddot changed the title Add error boundary components and exception reporting Add error boundary components and exception logging Feb 26, 2024

if [[ -n "$BUILDKITE_TAG" ]]; then
echo "--- :arrow_up: Upload Android source map"
node gutenberg/node_modules/react-native/scripts/compose-source-maps.js bundle/android/App.text.js.map bundle/android/App.js.map -o bundle/android/App.composed.js.map
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The composed source map is now generated as part of the bundle npm command.

src/errorLogging/index.js Outdated Show resolved Hide resolved
@fluiddot fluiddot marked this pull request as ready for review February 27, 2024 17:53
@fluiddot fluiddot requested a review from jhnstn February 27, 2024 17:55
Copy link
Member

@jhnstn jhnstn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good and the iOS test build works as expected.

I know we still need to test with an Android build but unless anything changes, this looks ready to go.

@fluiddot fluiddot added this to the 1.115.0 (24.5) milestone Mar 11, 2024
@fluiddot fluiddot enabled auto-merge March 11, 2024 09:43
@fluiddot fluiddot merged commit 2d78c5b into trunk Mar 11, 2024
17 of 20 checks passed
@fluiddot fluiddot deleted the add/error-boundary branch March 11, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve integration with sentry
2 participants