fix: standardize account type analytics#27596
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. |
Resolve conflicts in OAuthRehydration and import-wallet analytics spec. - OAuthRehydration: keep single wrong-password path; use accountType from Redux for REHYDRATION_PASSWORD_FAILED with handlePasswordError flow from main. - import-wallet.spec: use analyticsExpectations helper from main. - import-wallet.analytics: WALLET_SETUP_COMPLETED account_type srp_import (matches ImportFromSecretRecoveryPhrase / AccountType.SrpImport). Made-with: Cursor
tylerc-consensys
left a comment
There was a problem hiding this comment.
Seems like Imported is unused?
It is used in getSocialAccountType for existing users without a Google/Apple mapping and in ImportSRP module too. |
Resolved. |
| @@ -710,7 +719,7 @@ const OAuthRehydration: React.FC<OAuthRehydrationProps> = ({ | |||
|
|
|||
| const handleUseOtherMethod = () => { | |||
| track(MetaMetricsEvents.USE_DIFFERENT_LOGIN_METHOD_CLICKED, { | |||
There was a problem hiding this comment.
Just wanna inform that we don't have this event, Use Different Login Method Clicked in the schema.
## **Description** Bumps `@xmldom/xmldom` from `^0.8.10` to `^0.8.12` to address the failing production dependency audit (`GHSA-wh4c-j3r5-mjhp`). ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: Production dependency audit compliance Scenario: audit CI passes after xmldom patch update Given the repository is on branch chore/fix-audit-xmldom When I run yarn audit:ci Then no audit suggestions are reported ``` ## **Screenshots/Recordings** ### **Before** N/A (dependency-only change) ### **After** N/A (dependency-only change) ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk dependency-only update; main risk is unexpected behavior changes in XML parsing due to the transitive library patch bump. > > **Overview** > Updates the production dependency `@xmldom/xmldom` from `^0.8.10`/`0.8.11` to `^0.8.12` and refreshes `yarn.lock` to lock the new resolved version/checksum, addressing the flagged security advisory. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 776772f. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> (cherry picked from commit f6dcbae)
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
There are inconsistencies in how the account_type value is recorded in analytics events. Current values include hardcoded strings like 'social', 'default_google', 'social_import', and template literals like
metamask_${provider}. This PR standardizes all account_type values to use the AccountType enum, ensuring consistency across all analytics metrics.Changes:
metamask_${provider}with getSocialAccountType(provider, false) and AccountType.MetamaskChangelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TO-593
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low functional risk since changes are limited to analytics/tracing payload values and related tests, plus a small dependency patch bump. Main risk is metrics/dashboard continuity if downstream expects the old inconsistent
account_typestrings.Overview
Standardizes onboarding analytics/tracing
account_typevalues by routing all emitted values through theAccountTypeenum andgetSocialAccountType()helper, replacing hardcoded strings/template literals across wallet creation, SRP import, OAuth rehydration, and social login failure tracking.Adds coverage in
ChoosePassword,ImportFromSecretRecoveryPhrase, andOAuthServicetests to assert the newaccount_typemappings (including social vs rehydration and SRP vs social import). Also bumps@xmldom/xmldomfrom^0.8.10to^0.8.12.Reviewed by Cursor Bugbot for commit e3056c5. Bugbot is set up for automated code reviews on this repo. Configure here.