refactor(analytics): migrate accounts identity metrics consumers#43433
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. |
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (5 files, +11 -11)
|
64f30b4 to
c70124d
Compare
Builds ready [c70124d]
⚡ Performance Benchmarks (Total: 🟢 18 pass · 🟡 7 warn · 🔴 0 fail)
Bundle size diffs
|
c70124d to
a7a8a60
Compare
Builds ready [a7a8a60]
⚡ Performance Benchmarks (Total: 🟢 19 pass · 🟡 6 warn · 🔴 0 fail)
Bundle size diffs
|
a7a8a60 to
df32886
Compare
Builds ready [df32886] [reused from a7a8a60]
⚡ Performance Benchmarks (Total: 🟢 19 pass · 🟡 6 warn · 🔴 0 fail)
Bundle size diffs
|
Refresh slice from main-synced monolithic branch.
df32886 to
d2192c8
Compare
Builds ready [d2192c8]
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 8 warn · 🔴 1 fail)
Bundle size diffs
|
There was a problem hiding this comment.
Pull request overview
This PR continues the Analytics Phase B migration by removing remaining usage of legacy UI metrics fields in identity-related unit tests and switching the Authentication controller’s initialization messenger wiring to read the canonical analytics state.
Changes:
- Updated backup-and-sync UI unit test fixtures to use
completedMetaMetricsOnboardingandoptedIninstead ofparticipateInMetaMetrics. - Migrated
AuthenticationControllerinit messenger permissions fromMetaMetricsController:getMetaMetricsIdtoAnalyticsController:getState. - Updated
AuthenticationControllerInitto derive the MetaMetrics ID fromAnalyticsControllerstate during initialization.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/components/app/modals/identity/turn-on-backup-and-sync-modal/turn-on-backup-and-sync-modal.test.tsx | Updates mocked Redux state to use canonical analytics consent fields. |
| ui/components/app/identity/backup-and-sync-toggle/backup-and-sync-toggle.test.tsx | Updates mocked Redux state to use canonical analytics consent fields. |
| ui/components/app/identity/backup-and-sync-features-toggles/backup-and-sync-features-toggles.test.tsx | Updates mocked Redux state to use canonical analytics consent fields. |
| app/scripts/messenger-client-init/messengers/identity/authentication-controller-messenger.ts | Switches allowed init actions to AnalyticsController:getState. |
| app/scripts/messenger-client-init/identity/authentication-controller-init.ts | Reads analyticsId from AnalyticsController:getState to supply getMetaMetricsId. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Align with remote-feature-flag-controller-init by reading analyticsId directly from AnalyticsController:getState without a cast or empty-string fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
Builds ready [9da7aad]
⚡ Performance Benchmarks (Total: 🟢 15 pass · 🟡 10 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Part 5 of the Analytics Phase B split (supersedes monolithic #43406).
Owner: @MetaMask/accounts-engineers
Reason: Accounts identity init and backup-and-sync tests still reference legacy metrics fields.
Solution: Migrate authentication controller init/messenger and backup-and-sync tests to canonical analytics selectors.
Depends on: #43430
Changelog
CHANGELOG entry: null
Related issues
Part of https://github.com/MetaMask/MetaMask-planning/issues/7331
Manual testing steps
yarn startPre-merge author checklist
Pre-merge reviewer checklist