fix: set Sentry user id in dedicated metametrics integration, rather than rewriteReport#41191
Merged
gauthierpetetin merged 2 commits intoMar 27, 2026
Conversation
- Replace filterEvents with metaMetricsIntegration (sentry-metametrics.ts) using getMetaMetricsState - Attach user.id in processEvent for async/persisted resolution (incl. pre-init) - Stop setting user.id in rewriteReport; export MetaMetricsParticipation type - Add sentry-metametrics.test.ts; slim setupSentry rewriteReport tests Made-with: Cursor
Contributor
|
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. |
… arity processEvent now takes (event, hint, client) per @sentry/types Integration. Made-with: Cursor
|
Contributor
Builds ready [265ecad]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
7 tasks
19b01fd
into
feat/sentry-metametrics-user-id-3
199 checks passed
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.



Description
This PR improves #40491 by setting Sentry user id in dedicated metametrics integration, rather than rewriteReport.
The benefit of this change, is that it would work for pre-initialization errors as well (cf. @Gudahtt 's comment here).
Changelog
CHANGELOG entry: null
Related issues
See: #40491
Manual testing steps
See: #40491
Screenshots/Recordings
See: #40491
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes Sentry event filtering and user identification by moving MetaMetrics opt-in checks and
user.idattachment into a new integration, which could affect which events are sent and how they’re attributed (including early-init errors).Overview
Moves MetaMetrics-aware Sentry behavior out of
rewriteReportand into a dedicated integration. The newmetaMetricsIntegrationdrops events when MetaMetrics is disabled and, when opted-in, attachesevent.user.idfrom the same async MetaMetrics state resolution used for gating.Removes the old
filterEventsintegration and stopsrewriteReportfrom settingreport.user, updating tests accordingly (newsentry-metametricsunit tests; removedsetupSentryuser-id assertions).Written by Cursor Bugbot for commit 265ecad. This will update automatically on new commits. Configure here.