-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: remove @metamask/sdk-analytics and migrate SDKv1 events to MetaMetrics #28322
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
Open
wenfix
wants to merge
17
commits into
main
Choose a base branch
from
wapi-1375
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
04ffb05
feat(sdk-analytics): add ANALYTICS_TRACKED_RPC_METHODS constant
wenfix 39a2b91
feat(sdk-analytics): remove unconditional analytics.enable() from SDK…
wenfix 4491e7b
feat(sdk-analytics): migrate connectToChannel events to MetaMetrics
wenfix 55413c7
feat(sdk-analytics): migrate handleConnectionMessage events to MetaMe…
wenfix c7cec8a
feat(sdk-analytics): migrate handleSendMessage events to MetaMetrics
wenfix a0fb0e9
feat(sdk-analytics): remove @metamask/sdk-analytics dependency
wenfix eed168e
feat(sdk-analytics): define SDK wallet events in MetaMetricsEvents
wenfix 9052d93
fix(sdk-analytics): address code review issues
wenfix 3053876
Merge branch 'main' into wapi-1375
wenfix ced9071
fix(sdk-analytics): rename events to follow segment-schema conventions
adonesky1 78752e4
fix(sdk-analytics): rename MMConnect → Remote Connect Request Received
adonesky1 9548357
refactor: rename SDK RPC Request → Remote Connection RPC Request
adonesky1 fdb9828
refactor: remove redundant wallet_connection_user_approved/rejected V…
adonesky1 bda0739
refactor: align event names and properties with Segment schema
adonesky1 4e4725d
fix: move remote_session_id from sensitiveProperties to regular prope…
adonesky1 2d8786d
chore: use contants instead of hardcoded event names
wenfix f236a8f
chore: add revokePermissions and watchAsset to tracked methods
wenfix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -52,3 +52,22 @@ export const METHODS_TO_DELAY: { [method: string]: boolean } = { | |||||
| ...METHODS_TO_REDIRECT, | ||||||
| [RPC_METHODS.ETH_REQUESTACCOUNTS]: false, | ||||||
| }; | ||||||
|
|
||||||
| // RPC methods tracked for SDK wallet-side analytics (SDKv1 socket relay). | ||||||
| // Comparison is intentionally case-sensitive: RPC method names are standardised | ||||||
| // and the SDK is expected to send them in canonical casing. | ||||||
|
Comment on lines
+57
to
+58
Member
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.
Suggested change
|
||||||
| export const ANALYTICS_TRACKED_RPC_METHODS: string[] = [ | ||||||
| RPC_METHODS.ETH_SENDTRANSACTION, | ||||||
| RPC_METHODS.ETH_SIGNTYPEDEATA, | ||||||
| RPC_METHODS.ETH_SIGNTRANSACTION, | ||||||
| RPC_METHODS.PERSONAL_SIGN, | ||||||
| RPC_METHODS.WALLET_REQUESTPERMISSIONS, | ||||||
| RPC_METHODS.WALLET_SWITCHETHEREUMCHAIN, | ||||||
| RPC_METHODS.ETH_SIGNTYPEDEATAV3, | ||||||
| RPC_METHODS.ETH_SIGNTYPEDEATAV4, | ||||||
| RPC_METHODS.METAMASK_CONNECTSIGN, | ||||||
| RPC_METHODS.METAMASK_CONNECTWITH, | ||||||
| RPC_METHODS.METAMASK_BATCH, | ||||||
| RPC_METHODS.WALLET_REVOKEPERMISSIONS, | ||||||
| RPC_METHODS.WALLET_WATCHASSET, | ||||||
| ]; | ||||||
|
Member
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. we're missing some rpc methods here like wallet_revokePermissions, wallet_watchAsset i think |
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
DevLogger logs
[object Object]instead of event nameLow Severity
MetaMetricsEvents.REMOTE_CONNECTION_REQUEST_RECEIVED(and theRPC_REQUEST_RECEIVEDvariant) is anIMetaMetricsEventobject{ category: 'Remote Connection Request Received' }returned bygenerateOpt. Interpolating it directly in a template literal produces[object Object]instead of the event name.handleSendMessage.tscorrectly usesevent.categoryfor the same purpose—these two call sites need the same.categoryaccessor.Additional Locations (1)
app/core/SDKConnect/handlers/handleConnectionMessage.ts#L72-L73Reviewed by Cursor Bugbot for commit f236a8f. Configure here.