fix: sentry sessions (#26192) [cherry-pick]#26620
Merged
Gudahtt merged 1 commit intoVersion-v12.1.0from Aug 22, 2024
Merged
Conversation
|
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@sentry/types@8.19.0) |
64eb4c5 to
95ecf1e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## cherry-pick/update-to-sentry-8 #26620 +/- ##
==================================================================
- Coverage 69.83% 69.82% -0.01%
==================================================================
Files 1368 1368
Lines 48653 48670 +17
Branches 13434 13429 -5
==================================================================
+ Hits 33975 33981 +6
- Misses 14678 14689 +11 ☔ View full report in Codecov by Sentry. |
Collaborator
Builds ready [95ecf1e]
Page Load Metrics (155 ± 169 ms)
|
Base automatically changed from
cherry-pick/update-to-sentry-8
to
Version-v12.1.0
August 22, 2024 18:53
Remove all dynamic `autoSessionTracking` enablement. Add a custom Sentry transport to prevent any requests reaching Sentry if metrics are disabled. Only consider metrics enabled when preference is set and onboarding is complete. Enable Sentry if `METAMASK_ENVIRONMENT` is not `production` and `SENTRY_DSN_DEV` is specified. Remove the arguments to the `setupSentry` function. Flatten all the functions within `setupSentry.js`. Log all Sentry messages via the `debug` package based on the `DEBUG` environment variable. Add additional log messages for easier debug. Add mock `SENTRY_DSN_DEV` to Flask and MMI test builds. Remove duplication in package scripts.
95ecf1e to
eb89eaa
Compare
hjetpoluru
approved these changes
Aug 22, 2024
Collaborator
Builds ready [eb89eaa]
Page Load Metrics (74 ± 17 ms)
|
Collaborator
|
No release label on PR. Adding release label release-12.2.0 on PR, as PR was cherry-picked in branch 12.2.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #26192 for v12.1.0. Original description:
Description
Fix the automatic tracking of Sentry sessions, and refactor Sentry setup to simplify logic and improve logging.
Specifically:
autoSessionTrackingenablement.METAMASK_ENVIRONMENTis notproductionandSENTRY_DSN_DEVis specified.setupSentryfunction.process.envandglobal.stateHooksinternally.setupSentry.js.getStatecallback.debugpackage based on theDEBUGenvironment variable.DEBUG=metamask:sentry:*in.metamask.rcMETAMASK_DEBUGis enabled.SENTRY_DSN_DEVto Flask and MMI test builds.Related issues
Fixes: #2555 #15691
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist