-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: Track when RPC update from network banner is completed #37751
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
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. |
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (1 files, +6 -2)
|
4a8230a to
5d75564
Compare
Builds ready [5d75564]
UI Startup Metrics (1217 ± 84 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
mcmire
left a comment
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.
A couple of comments.
ui/pages/settings/networks-tab/networks-form/networks-form.test.js
Outdated
Show resolved
Hide resolved
|
@cryptodev-2s We should make sure to add the new event to the |
fb5a202 to
f4cd43d
Compare
Builds ready [f4cd43d]
UI Startup Metrics (1195 ± 85 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Done here https://github.com/Consensys/segment-schema/pull/366 |
|
@mcmire Right now we only send rpc_endpoint_url for the new RPC. I’m adding a second property to include the previous RPC URL as well, so we can easily track the ‘from → to’ transition without needing more complex aggregations. |
f4cd43d to
c19334f
Compare
Builds ready [c19334f]
UI Startup Metrics (1237 ± 113 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [6f5bd3d]
UI Startup Metrics (1243 ± 98 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [46d1cb1]
UI Startup Metrics (1247 ± 92 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Add NetworkConnectionBannerRpcUpdated event to track when users complete the RPC update flow initiated from the connection banner. Includes chain_id_caip and rpc_endpoint_url properties.
selectedRpcEndpoint cannot be undefined here because: - Save button is disabled without rpcEndpoints - trackRpcUpdateFromBanner only set for existing networks - Existing networks always have valid RPC endpoints
Change from single rpc_endpoint_url to from_rpc_domain and to_rpc_domain properties to track the complete migration path when users switch RPCs from the network connection banner. This enables analytics to identify: - Which RPC endpoints are problematic (high from_rpc_domain counts) - Which RPC endpoints users prefer (high to_rpc_domain counts) - Common migration patterns (FROM → TO pairs)
- Use optional chaining for existingNetwork.rpcEndpoints - Return 'unknown' for missing/corrupted from_rpc_domain - Add test for corrupted state scenario This prevents crashes if existingNetwork lacks rpcEndpoints while still capturing analytics data to identify data integrity issues.
46d1cb1 to
0704976
Compare
Builds ready [0704976]
UI Startup Metrics (1230 ± 95 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
mcmire
left a comment
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.
Tested and LGTM.
Description
Track RPC Update Completion from Network Banner
Summary
Adds
NetworkConnectionBannerRpcUpdatedevent to track when users complete the RPC update flow initiated from the network connection banner.Changes
NetworkConnectionBannerRpcUpdatedtrackRpcUpdateFromBannerflag is setchain_id_caip: CAIP-2 format (e.g.,eip155:1)from_rpc_domain: Original RPC domain being switched from (hostname for public RPCs,'custom'for private)to_rpc_domain: New RPC domain being switched to (hostname for public RPCs,'custom'for private)Why
Currently we track when users click "Update RPC" (
NetworkConnectionBannerUpdateRpcClicked), but not when they complete the update.sequenceDiagram participant User participant Banner as Network Banner participant Form as Network Form participant Analytics Note over Banner: Network issue detected Banner->>User: Show "degraded" or "unavailable" banner Note over Analytics: 📊 NetworkConnectionBannerShown User->>Banner: Click "Update RPC" Banner->>Analytics: 📊 NetworkConnectionBannerUpdateRpcClicked Note right of Analytics: Existing event<br/>Tracks user INTENT Banner->>Form: Navigate to network settings User->>Form: Edit RPC endpoint User->>Form: Click "Save" Form->>Analytics: 📊 NetworkConnectionBannerRpcUpdated Note right of Analytics: NEW event (this PR)<br/>Tracks COMPLETION Form->>User: Network updated ✅Related
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/WPC-172
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Adds
NetworkConnectionBannerRpcUpdatedevent and wires a banner->form flag to track completed RPC updates with CAIP chain ID and RPC domain metadata.MetaMetricsEventName.NetworkConnectionBannerRpcUpdated.setEditedNetwork/editedNetworkwithtrackRpcUpdateFromBanner.getEditedNetworkselector types accordingly.network-connection-banner: on "Update RPC", dispatchsetEditedNetwork({ chainId, trackRpcUpdateFromBanner: true })and navigate toNETWORKS_ROUTE.network-list-menu: passtrackRpcUpdateFromBannertoNetworksForm.NetworksForm: on Save (when editing) and flag is set, trackNetwork Connection Banner RPC Updatedwith:chain_id_caip(eip155:<decimal>),from_rpc_domain/to_rpc_domain(public host orcustom/unknown).hexToNumber,isPublicEndpointUrl,onlyKeepHostfor payload.setEditedNetwork.rpcEndpointshandling.Written by Cursor Bugbot for commit 0704976. This will update automatically on new commits. Configure here.