-
Notifications
You must be signed in to change notification settings - Fork 4.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
feat(1852): Implement sentry user report on error screen #27857
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
ead4ad9
to
6ff3574
Compare
354e60a
to
c9fcbc7
Compare
@@ -177,7 +177,7 @@ function missingKeyError( | |||
onError?.(error); | |||
log.error(error); | |||
|
|||
if (process.env.IN_TEST) { | |||
if (process.env.IN_TEST || process.env.ENABLE_SETTINGS_PAGE_DEV_OPTIONS) { |
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.
Adding this enable to trigger a crash from develop option
@@ -33,7 +33,7 @@ describe('Add snap account experimental settings @no-mmi', function (this: Suite | |||
await settingsPage.goToExperimentalSettings(); | |||
|
|||
const experimentalSettings = new ExperimentalSettings(driver); | |||
await settingsPage.check_pageIsLoaded(); | |||
await experimentalSettings.check_pageIsLoaded(); |
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.
Typo fixing
ui/pages/error/error.component.tsx
Outdated
let isMounted = true; // For preventing memory leak | ||
|
||
if (sentryButtonRef.current && isMounted) { | ||
feedback.attachTo(sentryButtonRef.current); // Attach feedback widget to button |
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.
Bound trigger to button click
setCurrentLocale(currentLocale, { | ||
...localeMessages, | ||
// @ts-expect-error - remove a language string in this page to trigger a page crash | ||
developerOptions: undefined, |
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.
Remove a language file in current page to trigger crash
@@ -326,7 +326,7 @@ class SettingsPage extends PureComponent { | |||
}, | |||
]; | |||
|
|||
if (process.env.ENABLE_SETTINGS_PAGE_DEV_OPTIONS) { | |||
if (process.env.ENABLE_SETTINGS_PAGE_DEV_OPTIONS || process.env.IN_TEST) { |
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.
enable develop options in e2e test
@@ -395,7 +395,8 @@ class SettingsPage extends PureComponent { | |||
/> | |||
<Route exact path={SECURITY_ROUTE} component={SecurityTab} /> | |||
<Route exact path={EXPERIMENTAL_ROUTE} component={ExperimentalTab} /> | |||
{process.env.ENABLE_SETTINGS_PAGE_DEV_OPTIONS && ( | |||
{(process.env.ENABLE_SETTINGS_PAGE_DEV_OPTIONS || | |||
process.env.IN_TEST) && ( |
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.
enable develop options in e2e test
f0acd52
to
e4489e9
Compare
Quality Gate passedIssues Measures |
Builds ready [e4489e9]
Page Load Metrics (1636 ± 60 ms)
|
e4489e9
to
ccdf22c
Compare
Builds ready [ccdf22c]
Page Load Metrics (1674 ± 53 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
32ea0a0
to
b30f186
Compare
Builds ready [b30f186]
Page Load Metrics (1793 ± 77 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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! The code changes look good to me! I also did the manual testing steps and it all worked for me locally. Great job! Just left one small comment.
064291c
to
c9d97fe
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.
perfect
Builds ready [c9d97fe]
Page Load Metrics (1975 ± 100 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@DDDDDanica, This is helpful PR for tracking sentry errors. I notice that when clicking on the Screen.Recording.2024-11-07.at.1.43.21.PM.mov |
hey @hjetpoluru thanks for checking, this is expected, as it is not crashing the extension, but close the extension for reload purpose. |
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.
Manually tested and functionality is LGTM and working as expected. Tests are written in POM and documentation is clear. Nice work @DDDDDanica
Description
Sentry provides a feature to collect user feedback to users when an issue occurs. This could be a great help to fix Sentry issues which sometimes come without a lot of context and are difficult to reproduce.
Hence we use out-of-box solution from sentry to implement User Feedback Widget via
Sentry.feedbackIntegration
. You can find more technical details in this comment.Design Figma link here.
What's expected in this PR:
ui/pages/error/error.component.js
to typescript, clean up / update language content, and improve the layout based on new design (see above Figma link) that would be consistent as mobile implementationdevelop options
to cause a page crash by remove one language file (for me was easiest way to trigger), which will bring us to error pageprocess.env.SUPPORT_REQUEST_LINK
ui/ducks/locale/locale.js
to typescript and add related testsThis is the scenario for extension:
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1852
Manual testing steps
SENTRY_DSN_DEV
in local env set up, and markENABLE_SETTINGS_PAGE_DEV_OPTIONS
=trueyarn webpack --watch --sentry
Participate in MetaMetrics
is opt inDescribe what happened
can open a sentry feedback form, then in your sentry project you can find the submitted form withinUser Feedback
sectionContact support
will redirect user to metamask support pageTry again
will close the extension and ready for reloadScreenshots/Recordings
Before
After
2024-10-16.13.09.02.mov
Pre-merge author checklist
Pre-merge reviewer checklist