refactor(analytics): migrate Batch 3-14: mobile-platform#26588
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-14_mobile-platform
…3-14_mobile-platform
…3-14_mobile-platform
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
This is an internal code refactoring that:
The termsOfUse module is used by ModalMandatory component for displaying Terms of Use modal, but no E2E tests specifically target this flow. The changes are purely internal refactoring with no functional impact, making E2E testing unnecessary. Performance Test Selection: |
Description
Phase 3 analytics migration (Batch 3-14): migrate Legal/Onboarding's terms-of-use utilities from
MetaMetrics.getInstance()to the new analytics system.Reason: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController.
Changes:
termsOfUse.tsnow usesanalytics.trackEvent()andAnalyticsEventBuilderfromapp/util/analytics; test mocks updated to mock the analytics utility instead ofMetaMetrics.getInstance().Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-302 (Batch 3-14)
Manual testing steps
Screenshots/Recordings
N/A – analytics migration, no UI change.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk refactor that swaps the event tracking implementation for terms-of-use shown/accepted; behavior should be equivalent but could impact whether/when these two events are emitted if the new analytics queueing differs from
MetaMetrics.getInstance().Overview
Migrates terms-of-use analytics emission from
MetaMetrics.getInstance().trackEvent/MetricsEventBuilderto the sharedanalytics.trackEventhelper withAnalyticsEventBuilderfor theUSER_TERMS_SHOWNandUSER_TERMS_ACCEPTEDevents.Updates
termsOfUseunit tests to mockapp/util/analytics/analyticsand assert calls toanalytics.trackEventinstead of mockingMetaMetrics.Written by Cursor Bugbot for commit f7c5c93. This will update automatically on new commits. Configure here.