refactor(analytics): migrate Batch 3-11: mobile-platform#26567
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. |
…3-11_mobile-platform
…3-11_mobile-platform
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The LedgerSelectAccount component is used for Ledger hardware wallet account selection. While the change is low-risk (1:1 hook migration), selecting SmokeAccounts provides minimal coverage for account-related flows including hardware wallet account management. The unit tests have been properly updated to mock the new hook. No other tags are needed because:
Performance Test Selection: |
Description
Phase 3 analytics migration (Batch 3-11): migrate Hardware Wallet's
LedgerSelectAccountcomponent fromuseMetricsto the new analytics system.Reason: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController.
Changes:
LedgerSelectAccount/index.tsxnow usesuseAnalyticsfromapp/components/hooks/useAnalytics/useAnalyticsinstead ofuseMetrics; test mocks updated to mockuseAnalyticsinstead ofuseMetrics.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-302 (Batch 3-11)
Manual testing steps
Screenshots/Recordings
N/A – analytics migration, no UI change.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Swaps the analytics hook used by
LedgerSelectAccountand updates its unit test mock; behavior should be equivalent but could affect event emission if the new hook differs in runtime wiring.Overview
Migrates hardware wallet
LedgerSelectAccountanalytics from the deprecateduseMetricshook to the newuseAnalyticshook while keeping the sametrackEvent/createEventBuildercall sites.Updates
LedgerSelectAccounttests to mockuseAnalyticsinstead ofuseMetricsso existing analytics-related assertions continue to run against the new hook.Written by Cursor Bugbot for commit d71565b. This will update automatically on new commits. Configure here.