feat: split request_source to distinguish SDKv1 from MWP#28697
feat: split request_source to distinguish SDKv1 from MWP#28697
Conversation
Previously both SDKv1 (socket relay) and MWP/SDKv2 connections produced
the same request_source value 'MetaMask-SDK-Remote-Conn' on RPC pipeline
events (Transaction Added, Signature Requested, etc.), making them
indistinguishable in analytics.
Adds a transport field ('socket_relay' | 'mwp') to the analytics param
passed to getRpcMethodMiddleware, and branches getSource() on it:
- SDKv1: 'MetaMask-SDK-Remote-Conn' (unchanged, preserves data continuity)
- MWP/V2: 'MetaMask-Connect' (new)
Relates to WAPI-1398.
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The PR introduces transport-type differentiation in the RPC middleware analytics tracking layer:
Why these tags:
The changes are primarily analytics/tracking changes and don't alter core RPC logic, but since RPCMethodMiddleware is a critical shared component for all dApp interactions, running dApp-related test suites is prudent to ensure no regressions. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |



Summary
Both SDKv1 (socket relay) and MWP/SDKv2 connections produced the same
request_sourcevalue (MetaMask-SDK-Remote-Conn) on RPC pipeline events (Transaction Added,Signature Requested, etc.), making them indistinguishable in analytics.Adds a
transportfield (socket_relay|mwp) to the analytics param passed togetRpcMethodMiddlewareand branchesgetSource()on it:MetaMask-SDK-Remote-Conn(unchanged — preserves data continuity)MetaMask-Connect(new)Related
Test plan
request_sourceisMetaMask-SDK-Remote-Connrequest_sourceisMetaMask-Connectrequest_sourcevalues unchangedNote
Medium Risk
Touches the central RPC middleware metadata path; while behavior changes are limited to analytics
request_sourcelabeling, any unexpectedtransportvalues could misclassify remote-connection events in downstream analytics.Overview
Updates RPC analytics tagging to split remote-connection
request_sourceby transport. SDKv1 (socket relay) continues emittingMetaMask-SDK-Remote-Conn, while MWP/SDKv2 now emits the newMetaMask-Connectconstant via a newly passedanalytics.transportfield.Reviewed by Cursor Bugbot for commit 33e9aaf. Bugbot is set up for automated code reviews on this repo. Configure here.