refactor(analytics): PR A2 split types from MetaMetrics#26988
Conversation
… analytics.types.ts and analyticsDataDeletion.types.ts
|
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26988 +/- ##
=======================================
Coverage 81.68% 81.69%
=======================================
Files 4652 4654 +2
Lines 121697 121764 +67
Branches 26740 26754 +14
=======================================
+ Hits 99412 99476 +64
+ Misses 15369 15368 -1
- Partials 6916 6920 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
|
addin skip sonar label as it fails on the duplication which is expected as I have to finish the migration to remove the old file and meanwhile we have twice the code. But that's temporary |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The diffs show primarily type import path changes and consolidation of analytics types (moving from core/Analytics to util/analytics). While the changes appear refactor-oriented (type source updates and analytics event typing), they affect the TransactionController metrics pipeline, which is tightly coupled to transaction and signature confirmation flows. Given that TransactionController is central to:
Running SmokeConfirmations ensures that all core transaction and signature confirmation flows still execute correctly end-to-end and that no regression was introduced through analytics-related refactoring. No changes were made to account management, network management, identity sync, trade UI, ramps, card, perps, predictions, or multi-chain APIs directly. Therefore, broader tags are not required. This is assessed as medium risk because it touches critical Engine controller code, but the actual changes appear limited to analytics typing and imports rather than transaction logic. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|


Description
Part of the analytics cleanup workstream (#26686).
MetaMetrics.types.tsinto:app/util/analytics/analyticsDataDeletion.types.ts(data deletion)app/util/analytics/analytics.types.ts(event/transitional + domain types).ISegmentClientandIMetaMetricsin the old file and re-exports all moved types from the new locations so consumers remain unchanged.Changelog
CHANGELOG entry: null
Related issues
Fixes: #26811
Manual testing steps
N/A
Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Primarily a type-only refactor that moves analytics-related TypeScript types and updates imports, with minimal runtime impact beyond a small exported type guard. Risk is limited to potential compile-time/import path regressions in analytics and transaction-metrics call sites.
Overview
Refactors analytics type ownership by moving legacy MetaMetrics event and JSON property types into
app/util/analytics/analytics.types.ts, and extracting Segment data-deletion/GDPR types into the newapp/util/analytics/analyticsDataDeletion.types.ts.Updates affected modules (including
useAnalytics,AnalyticsEventBuilder, and transaction-controller metrics builders) to import these types from the new util locations, and adds a focused unit test for the newisTrackingEventtype guard.Written by Cursor Bugbot for commit 10086c1. This will update automatically on new commits. Configure here.