chore(analytics): migrate useMetrics→useAnalytics, MetricsEventBuilder→AnalyticsEventBuilder, addTraitsToUser→identify (unowned files)#31249
Conversation
…r->identify (unowned files) Migrates 5 test files from useMetrics to useAnalytics and renames addTraitsToUser to identify in 2 test files. Also removes stale addTraitsToUser mock field from FeatureFlagOverride test (PR1 cleanup item - verify gate prerequisite for PR8). Files: - DeepLinkModal.perf-test.tsx - TrendingView.test.tsx - NetworkMultiSelector.test.tsx (useMetrics + identify rename) - useNetworkConnectionBanner.test.tsx - GestureWebViewWrapper.test.tsx - NetworksManagementView.test.tsx (identify rename) - FeatureFlagOverride.test.tsx (stale mock cleanup) Co-authored-by: Cursor <cursoragent@cursor.com>
…in additional unowned files Migrates DeleteWalletModal, AccountStatus, backupUtils, and SRP tests from MetricsEventBuilder to AnalyticsEventBuilder. 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. |
…mentation instead of jest.fn() Co-authored-by: Cursor <cursoragent@cursor.com>
…ountStatus test Co-authored-by: Cursor <cursoragent@cursor.com>
…ntStatus mock Co-authored-by: Cursor <cursoragent@cursor.com>
… AccountStatus test Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Reviewed by Cursor Bugbot for commit 73e4c1d. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |

Description
Migrates the remaining unowned files from the legacy analytics system (
useMetrics,MetricsEventBuilder,addTraitsToUser) to the new system (useAnalytics,AnalyticsEventBuilder,identify).This is part of the analytics migration cleanup series. These files have no CODEOWNERS entry, so this PR can be reviewed and merged by any mobile-platform contributor.
Files migrated:
DeleteWalletModal/index.tsx—useMetrics→useAnalyticsAccountStatus/index.tsx—useMetrics→useAnalyticsbackupUtils.ts—addTraitsToUser→identifyChangelog
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
Refactor-only import and API renames with test mock updates; no intended change to analytics payloads or user-facing behavior.
Overview
Finishes analytics cleanup for unowned files by swapping legacy
MetricsEventBuilder/useMetricsusage forAnalyticsEventBuilder(util/analytics) anduseAnalytics, with onboarding flows still going throughtrackOnboarding.Production:
DeleteWalletModal,AccountStatus, andbackupUtilsnow build events viaAnalyticsEventBuilder.createEventBuilderinstead of the core metrics builder (same events and properties).Tests: Perf/unit tests mock
useAnalyticsinstead ofuseMetrics; several suites adoptcreateMockUseAnalyticsHook/createMockEventBuilder;NetworksManagementViewmock usesidentifyinstead ofaddTraitsToUser;TrendingViewdropswithMetricsAwarenessfrom the mock.Reviewed by Cursor Bugbot for commit 97a1919. Bugbot is set up for automated code reviews on this repo. Configure here.