-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: pass anon_id from dapp to wallet in SDKConnectV2 connection metadata for cross-side analytics correlation #28470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a3d6a3b
b794a4a
1ad1f2a
45e194c
70344e4
1e93d48
3771262
1087ce1
ec0f6c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,5 +148,18 @@ export function isConnectionRequest(data: unknown): data is ConnectionRequest { | |
| return false; | ||
| } | ||
|
|
||
| // analytics is purely telemetry — strip it when malformed rather than | ||
| // rejecting the connection, so a dapp-side bug can't break connectivity. | ||
| if (metadata.analytics !== undefined) { | ||
| if ( | ||
| typeof metadata.analytics !== 'object' || | ||
| metadata.analytics === null || | ||
| typeof metadata.analytics.remote_session_id !== 'string' || | ||
| !isUUID(metadata.analytics.remote_session_id) | ||
| ) { | ||
| delete (metadata as unknown as Record<string, unknown>).analytics; | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type guard mutates its input argument silentlyLow Severity The Reviewed by Cursor Bugbot for commit ec0f6c9. Configure here. |
||
| } | ||
adonesky1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return true; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,7 @@ export interface Metadata { | |
| version: string; | ||
| platform: string; | ||
| }; | ||
| analytics?: { | ||
| remote_session_id: string; | ||
| }; | ||
| } | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated behavior change bundled without test coverage
Medium Severity
getAddressAccountTypereceivesselectedCaipAccountIds[0], which is a CAIP account ID (e.g. a Solanaeip155:…orsolana:…format). Internally, the function parses the address then callstoFormattedAddress, which usestoChecksumAddress— an EVM-only operation that will throw for non-EVM chain addresses. While thetry/catchgracefully defaults to'unknown', the previous hard-coded'multichain'value was semantically more accurate for this multichain flow. This behavior change (from'multichain'to a per-address keyring lookup) is unrelated to theanon_idplumbing described in the PR and silently degrades theaccount_typeanalytics property to'unknown'for all non-EVM account selections.Additional Locations (1)
app/components/Views/MultichainAccounts/MultichainAccountConnect/MultichainAccountConnect.tsx#L31-L32Reviewed by Cursor Bugbot for commit 3771262. Configure here.