refactor(analytics): migrate Batch 3-1: mobile-platform#26312
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The changes are:
This is a low-risk change because:
Since this is a straightforward refactoring with comprehensive unit test coverage and no functional changes, E2E tests are not necessary to validate this change. Performance Test Selection: |
|
|
Missing release label release-7.67.0 on PR. Adding release label release-7.67.0 on PR and removing other release labels(release-7.68.0), as PR was cherry-picked in branch 7.67.0. |



Description
Phase 3 analytics migration (Batch 3-1): migrate Authentication core's
Authentication.tsfromMetaMetrics.getInstance()to the new analytics system.Reason: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController.
Changes:
Authentication.tsnow usesanalytics.isEnabled()fromapp/util/analytics/analyticsinstead ofMetaMetrics.getInstance().isEnabled(); test mocks updated to mock the analytics utility instead of MetaMetrics.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-301 (Batch 3-1)
Manual testing steps
Screenshots/Recordings
N/A – analytics migration, no UI change.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Small refactor limited to how the “metrics enabled” flag is read plus corresponding test mock updates; minimal behavioral risk beyond potential differences in enabled-state resolution.
Overview
Authentication.unlockWalletnow uses the sharedanalytics.isEnabled()helper (instead ofMetaMetrics.getInstance().isEnabled()) to decide whether to route users into the opt-in metrics onboarding flow.Updates
Authentication.test.tsto mock the newanalyticsmodule and replaces allMetaMetricsspies withanalytics.isEnabledspies to keep navigation/login tests consistent.Written by Cursor Bugbot for commit 22c425d. This will update automatically on new commits. Configure here.