You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- feat: Add MetaMetrics event to "Infinite spinner" error screen
cp-13.3.0 (#35619)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
This PR implements user-controlled error reporting on the critical error
screen, allowing users to opt into sending crash reports to help with
debugging while maintaining transparency about data collection.
**Error Reporting Checkbox:**
- Added checkbox above restart button with "Report this error" text
- Checkbox pre-selected by default
- Info icon (ℹ️) next to checkbox text
**Legal Text Popover:**
- Info icon shows popover with legal text on click
- A bit styling with rounded corners and shadow
- Explains data collection and privacy policy
**Sentry Integration:**
- Checkbox checked → sends error to Sentry via fetch API on restart
- Checkbox unchecked → no data sent, just restarts MetaMask
- Includes error details, user agent, extension version
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
[](https://codespaces.new/MetaMask/metamask-extension/pull/35619?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Added checkbox for emitting Sentry event when
restarting MetaMask from error page
## **Related issues**
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/5651
## **Manual testing steps**
1. open the extension's devtools
2. execute the following code (its creates an invalid state object):
```
// browser and chrome are NOT scuttled in test builds, so we can use them
// to access the storage API here
const browser = globalThis.browser ?? globalThis.chrome;
// corrupt the primary database by setting `meta` to `null`
browser.storage.local.set({ meta: null }, () => {
browser.runtime.reload()
});
```
3. open the popup. The error modal should be displayed to the user.
4. Click i icon beside "report this error" should show a popover of
legal text
5. Click restart metamask, should see a request sending to sentry before
reloading
6. If uncheck the checkbox "report this error", there won't be any
request sending to sentry before reloading
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
**Recording:**
https://www.loom.com/share/876c2fefb7224c1da85c14d2538d9ca2?sid=3e5835e7-2ec5-4277-ac01-ba072460b602
**Screenshot: **
<img width="406" height="606" alt="Screenshot 2025-09-10 at 00 36 43"
src="https://github.com/user-attachments/assets/9d152017-e3ce-4da5-81dc-b4f8e5434a23"
/>
<img width="403" height="605" alt="Screenshot 2025-09-10 at 00 36 48"
src="https://github.com/user-attachments/assets/386ccd0a-3fde-48f0-b3dc-acbbe18a01aa"
/>
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
---------
Co-authored-by: dddddanica <[email protected]>
[5adb0e7](5adb0e7)
Co-authored-by: Jongsun Suh <[email protected]>
Co-authored-by: dddddanica <[email protected]>
0 commit comments