Skip to content

refactor: rename analytics source from sdk_connect_v2 to mm_connect#28359

Merged
adonesky1 merged 1 commit into
mainfrom
refactor/WAPI-1388-rename-source-mm-connect
Apr 3, 2026
Merged

refactor: rename analytics source from sdk_connect_v2 to mm_connect#28359
adonesky1 merged 1 commit into
mainfrom
refactor/WAPI-1388-rename-source-mm-connect

Conversation

@adonesky1

@adonesky1 adonesky1 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The product/brand name is MetaMask Connect (MWP), not "SDK Connect V2". This renames the analytics source property value from sdk_connect_v2 to mm_connect so events correctly reflect the product name.

Changes:

  • SourceType.SDK_CONNECT_V2 = 'sdk_connect_v2'SourceType.MM_CONNECT = 'mm_connect' in both useAnalytics.types.ts (primary) and useMetrics.types.ts (deprecated compat copy)
  • Updated the return value in useOriginSource.ts
  • Updated test assertions and descriptions in useOriginSource.test.ts

WAPI-1388 - https://consensyssoftware.atlassian.net/browse/WAPI-1388

Depends on the useOriginSource fix from WAPI-1380 (already merged to main).

CHANGELOG entry: n/a

Test plan

  • useOriginSource.test.ts — all 8 tests pass with renamed values

Note

Low Risk
Low risk rename of an analytics SourceType value and constant key; primary risk is mislabeling or missing any downstream consumers expecting the old value.

Overview
Renames the analytics source identifier for SDK v2/MetaMask Connect from sdk_connect_v2 (SDK_CONNECT_V2) to mm_connect (MM_CONNECT) in the canonical useAnalytics types and the deprecated useMetrics compatibility export.

Updates useOriginSource to emit SourceType.MM_CONNECT when an origin matches a v2 connection, and adjusts useOriginSource unit tests to assert the new source and wording.

Written by Cursor Bugbot for commit 96ede62. This will update automatically on new commits. Configure here.

The product/brand name is MetaMask Connect (MWP), not "SDK Connect V2".
Update the SourceType enum key and string value so analytics events
carry source: 'mm_connect' instead of 'sdk_connect_v2'.

WAPI-1388
@adonesky1 adonesky1 requested a review from a team as a code owner April 2, 2026 19:48
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-wallet-integrations Wallet Integrations team label Apr 2, 2026
@github-actions github-actions Bot added size-S risk-low Low testing needed · Low bug introduction risk labels Apr 2, 2026
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes in this PR are limited to:

  1. Renaming an analytics SourceType constant: SDK_CONNECT_V2: 'sdk_connect_v2'MM_CONNECT: 'mm_connect' in both useAnalytics.types.ts and useMetrics.types.ts.
  2. Updating useOriginSource.ts to return SourceType.MM_CONNECT instead of SourceType.SDK_CONNECT_V2 for UUID origins found in v2Connections.
  3. Updating tests to match the new naming.

This is a pure analytics/metrics rename with no functional behavior changes:

  • The hook logic is identical — only the returned string value changes
  • No UI changes, no state management changes, no controller changes
  • No navigation or flow changes
  • E2E tests do not validate analytics source type string values
  • The useOriginSource hook consumers (AccountConnect, MultichainAccountConnect, PermissionApproval) use the source type only for analytics event tracking, not for conditional logic that affects user-visible behavior

No E2E test tags are needed as no user-facing functionality is changed. The change is purely an internal analytics label rename.

Performance Test Selection:
This change only renames an analytics source type constant. There are no UI rendering changes, no state management changes, no data loading changes, and no changes to critical user flows that would affect performance metrics.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented Apr 2, 2026

Copy link
Copy Markdown

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Apr 3, 2026

@Cal-L Cal-L left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@adonesky1 adonesky1 added this pull request to the merge queue Apr 3, 2026
Merged via the queue into main with commit 8da8416 Apr 3, 2026
94 of 99 checks passed
@adonesky1 adonesky1 deleted the refactor/WAPI-1388-rename-source-mm-connect branch April 3, 2026 19:15
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 3, 2026
@metamaskbot metamaskbot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-7.74.0 Issue or pull request that will be included in release 7.74.0 risk-low Low testing needed · Low bug introduction risk size-S team-wallet-integrations Wallet Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants