chore(analytics): migrate MetricsEventBuilder→AnalyticsEventBuilder and useMetrics→useAnalytics (web3auth/onboarding files)#31250
Conversation
…and useMetrics->useAnalytics (web3auth files) Migrates 9 web3auth-owned files from MetricsEventBuilder to AnalyticsEventBuilder with legacy-properties audit, plus 1 useMetrics->useAnalytics migration in Onboarding test and 2 addTraitsToUser->identify renames. Files: - Onboarding/index.tsx (MetricsEventBuilder->AnalyticsEventBuilder) - Onboarding/index.test.tsx (useMetrics->useAnalytics + identify rename) - WalletCreationError/SRPErrorScreen.tsx - ManualBackupStep2/index.js - ManualBackupStep3/index.js + index.test.tsx - ChoosePassword/index.tsx + index.test.tsx - AccountBackupStep1/index.js - AccountBackupStep1B/index.js - ImportFromSecretRecoveryPhrase/index.js - ManualBackupStep1/index.test.tsx (identify rename) 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f49ae5cff1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Affected components:
Tag selection rationale:
Risk is low because this is a pure refactoring (same API, renamed class), but the onboarding flow is critical enough to warrant validation that the analytics tracking still fires correctly through the new import path. Performance Test Selection: |
Description
Migrates all web3auth and onboarding files from the legacy analytics system (
useMetrics,MetricsEventBuilder) to the new system (useAnalytics,AnalyticsEventBuilder).Part of the analytics migration cleanup series. All changes are in files owned by the web3auth/onboarding team.
Files migrated:
AccountBackupStep1,AccountBackupStep1B,ManualBackupStep1-3,ImportFromSecretRecoveryPhrase,Onboarding,ChoosePassword,WalletCreationError/SRPErrorScreenChangelog
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
Mechanical import/API rename across onboarding analytics with no wallet or auth logic changes; main risk is test/mock drift if event payloads diverge from the legacy builder.
Overview
This PR continues the analytics migration in web3auth/onboarding screens by swapping
MetricsEventBuilderforAnalyticsEventBuilder(util/analytics) everywhere onboarding events are built beforetrackOnboarding.Touched flows include account backup steps, manual backup, import-from-SRP, choose password, onboarding root, and wallet-creation error. Runtime behavior is intended to stay the same—same events, properties, and
trackOnboardingwiring; only the builder import and class name change.Tests are aligned with the new stack: mocks target
AnalyticsEventBuilderinstead ofMetricsEventBuilder, legacyMetaMetricssingleton mocks are dropped whereuseAnalyticsalready covers the surface, andaddTraitsToUserexpectations becomeidentify. Onboarding tests dropwithMetricsAwarenessHOC wiring in favor of theuseAnalyticsmock.Reviewed by Cursor Bugbot for commit 33d3acd. Bugbot is set up for automated code reviews on this repo. Configure here.