chore(analytics): migrate MetricsEventBuilder→AnalyticsEventBuilder in transaction controller metrics (confirmations)#31252
Conversation
…and remove setSaveDataRecording (confirmations) Migrates transaction-controller utils.ts and metrics.ts from MetricsEventBuilder to AnalyticsEventBuilder. Removes the two setSaveDataRecording(event.saveDataRecording) calls from metrics.ts (F.2 - they are now inert since AnalyticsEventBuilder has no saveDataRecording field). Updates metrics.test.ts accordingly. Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
…cs test Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #31252 +/- ##
==========================================
+ Coverage 82.94% 83.04% +0.09%
==========================================
Files 5617 5683 +66
Lines 144783 145835 +1052
Branches 33663 33980 +317
==========================================
+ Hits 120094 121112 +1018
+ Misses 16614 16538 -76
- Partials 8075 8185 +110 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Impact Assessment:
Why SmokeConfirmations:
Why NOT broader tags:
Performance tests: Not needed - these are analytics/metrics code changes with no impact on rendering, data loading, or app performance. Performance Test Selection: |
Description
Migrates the transaction controller event handler from the legacy
MetricsEventBuildertoAnalyticsEventBuilder. Also removes thesetSaveDataRecordingcall which was part of the now-removed data-recording chain.Part of the analytics migration cleanup series. All changes are in files owned by the confirmations team.
Changelog
CHANGELOG entry: null
Related issues
Refs: #26686
Manual testing steps
N/A — analytics-only refactor, no behaviour change.
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Made with Cursor
Note
Low Risk
Analytics-only refactor with no user-facing behavior change; main nuance is omitting saveDataRecording on tracked events until the analytics-controller types align.
Overview
Transaction controller metrics now build events with
AnalyticsEventBuilderinstead of legacyMetricsEventBuilder, includinggenerateEventinutils.tsand the handlers inmetrics.ts.Tracking no longer calls
setSaveDataRecordingwhen forwarding events toAnalyticsController:trackEvent. A temporaryinitMessengercast works around a type mismatch until@metamask/analytics-controllerdropssaveDataRecordingfrom its event type.Tests use a single mocked
AnalyticsEventBuilderand assert against that builder for all transaction metric handlers.Reviewed by Cursor Bugbot for commit b1d9f07. Bugbot is set up for automated code reviews on this repo. Configure here.