refactor(analytics): migrate notifications events#43887
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. |
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (7 files, +179 -124)
🔔 @MetaMask/notifications (17 files, +294 -221)
|
Builds ready [a585d13]
⚡ Performance Benchmarks (Total: 🟢 13 pass · 🟡 11 warn · 🔴 0 fail)
Bundle size diffs
|
a585d13 to
f818574
Compare
Builds ready [f818574]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 7 warn · 🔴 0 fail)
Bundle size diffs
|
f818574 to
eac630b
Compare
eac630b to
31f7bb1
Compare
31f7bb1 to
221c931
Compare
221c931 to
5c3cd70
Compare
5c3cd70 to
1d231e4
Compare
Builds ready [1d231e4] [reused from 31f7bb1]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)
Bundle size diffs: data not available. |
1d231e4 to
697cf42
Compare
697cf42 to
eb39a08
Compare
eb39a08 to
8dc1e35
Compare
The helpers file was not imported by any integration test in this PR. Co-authored-by: Cursor <cursoragent@cursor.com>
| type MockVar = any; | ||
|
|
||
| describe('SnapFooterButton', () => { | ||
| const store = configureStore(mockState); |
There was a problem hiding this comment.
store is required because useAnalytics() depends on Redux
…menu Use page title for properties.location to match legacy contextPropsIntoEventProperties PageTitle behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
Reconcile with main's notification preferences refactor: keep analytics createEventBuilder migration, adopt simplified global menu notifications flow, remove deleted turn-on-notifications components, and update integration test assertions for trackAnalyticsEvent. Co-authored-by: Cursor <cursoragent@cursor.com>
Builds ready [b22f11c]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
The integration test expects trackAnalyticsEvent RPC after toggling marketing preferences, which requires createEventBuilder instead of legacy trackEvent. Co-authored-by: Cursor <cursoragent@cursor.com>
Builds ready [6b364fb]
⚡ Performance Benchmarks (Total: 🟢 13 pass · 🟡 11 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…ests NotificationSettingsSection now calls useAnalytics, which pulls useSegmentContext and requires confirmTransaction state missing from the minimal test store. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Builds ready [de116a3]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 7 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
baptiste-marchand
left a comment
There was a problem hiding this comment.
LGTM for Engagement files


Description
Sub-PR of umbrella tracker #43885.
Migrates MetaMetrics
trackEventcall sites in this CODEOWNERS domain tocreateEventBuilder+trackEventviauseAnalytics()(UI) orapp/scripts/controllers/analytics(background).Dependency note: Can merge in parallel with other domain PRs.
Files in this PR: 32
Changelog
CHANGELOG entry: null
Related issues
Part of analytics migration umbrella: #43885
Manual testing steps
yarn start.Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Analytics-only refactor in notifications UI and push init; event names and properties are preserved, with test coverage updated for the new API.
Overview
Migrates notifications analytics from legacy
MetaMetricsContext/MetaMetricsController:trackEventtocreateEventBuilder+trackEventviauseAnalytics()in UI andapp/scripts/controllers/analyticsin the push-notification init path.Coverage includes notification list/detail interactions, settings toggles, activation modal, global menu “notifications opened”, and push received/clicked handlers. Event payloads stay the same; only the plumbing and builder shape change. Integration tests now assert
trackAnalyticsEventwithnameandproperties.categoryinstead oftrackMetaMetricsEventwith top-levelevent/category. Several unit tests mockuseAnalyticsinstead of wrappingMetaMetricsContext.The push controller init messenger no longer delegates
MetaMetricsController:trackEvent. Global menu support-link tracking usesuseSegmentContextfor page title where context props were injected before. Unrelated: a smallString(type)fix in notification preference error logging.Reviewed by Cursor Bugbot for commit de116a3. Bugbot is set up for automated code reviews on this repo. Configure here.