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

[TEST] Add error boundary components and exception logging #6654

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Feb 20, 2024

Related PRs:

This PR is only for testing purposes. It's a test branch of #6655 that includes forcing JavaScript exceptions.

To test

Note

Use the following installable builds for testing:

Block-level error boundary

  1. Create a post.
  2. Add an Image block.
  3. Observe that the block is not rendered and an error message is displayed instead.
  4. Go to Sentry and check errors generated in the last hour for the environment a8cBranchTest (link).
  5. Observe that a new Sentry event is registered with name Error in Image block.
  6. Navigate to the Sentry event and observe the following items:
    1. The stack trace is symbolicated and points to the correct code line (reference).
    2. It contains a tag with the Gutenberg Mobile version.
    3. The event context contains information about React Native (e.g. version).

Editor-level error boundary

  1. (Continue from above test case)
  2. Switch to the HTML mode.
  3. Observe that the editor stops rendering content and shows an error message instead.
  4. Go to Sentry and check errors generated in the last hour for the environment a8cBranchTest (link).
  5. Observe that a new Sentry event is registered with name Error in editor (reference).
  6. Navigate to the Sentry event and observe the following items:
    1. The stack trace is symbolicated and points to the correct code line.
    2. It contains a tag with the Gutenberg Mobile version.
    3. The event context contains information about React Native (e.g. version).

Unhandled crash

Note

The unhandled error is generated as a side effect of forcing the error in the HTML mode editor.

  1. (Continue from above test case)
  2. Tap on the ... button located in the top bar.
  3. Observe that the app crashes.
  4. Open the app again.
  5. Go to Sentry and check errors generated in the last hour for the environment a8cBranchTest (link).
  6. Observe that a new Sentry event is registered with name Cannot read property 'replace' of undefined.
  7. Navigate to the Sentry event and observe the following items:
    1. The stack trace is symbolicated and points to the correct code line.
    2. It contains a tag with the Gutenberg Mobile version.
    3. The event context contains information about React Native (e.g. version).
    4. The error is marked as unhandled.
  8. Observe that there's also a RCTFatalException Sentry event with information about the native crash.

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.

.buildkite/pipeline.yml Outdated Show resolved Hide resolved
@fluiddot fluiddot changed the base branch from trunk to add/error-boundary February 23, 2024 10:06
@fluiddot fluiddot changed the title [TEST] Error boundary [TEST] Add error boundary components and exception logging Feb 26, 2024
@fluiddot fluiddot force-pushed the test/error-boundary-crash branch 3 times, most recently from e01f531 to 31dc644 Compare February 27, 2024 15:52
Base automatically changed from add/error-boundary to trunk March 11, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] DO NOT MERGE Do not merge this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant