Skip to content

Conversation

@cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Nov 12, 2025

Description

Track RPC Update Completion from Network Banner

Summary

Adds NetworkConnectionBannerRpcUpdated event to track when users complete the RPC update flow initiated from the network connection banner.

Changes

  • New MetaMetrics event: NetworkConnectionBannerRpcUpdated
  • Tracked on: Network form submission when trackRpcUpdateFromBanner flag is set
  • Properties:
    • chain_id_caip: CAIP-2 format (e.g., eip155:1)
    • rpc_endpoint_url: Sanitized URL (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 ✅
Loading

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/WPC-172

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Adds NetworkConnectionBannerRpcUpdated and tracks it on network form save when launched from the banner, including CAIP chain ID and sanitized RPC URL; wires flag through state and updates tests.

  • MetaMetrics:
    • Add MetaMetricsEventName.NetworkConnectionBannerRpcUpdated.
    • Track on NetworksForm submit when trackRpcUpdateFromBanner is true with properties: chain_id_caip (e.g., eip155:1) and rpc_endpoint_url (host for public endpoints, custom otherwise).
  • UI/State Wiring:
    • NetworkConnectionBanner sets edited network with { chainId, trackRpcUpdateFromBanner: true } and navigates to NETWORKS_ROUTE.
    • NetworkListMenu reads trackRpcUpdateFromBanner from getEditedNetwork and passes it to NetworksForm.
    • Extend app state, selector getEditedNetwork, and action setEditedNetwork to include trackRpcUpdateFromBanner.
    • Minor util imports (hexToNumber, isPublicEndpointUrl).
  • Tests:
    • Update banner tests to expect trackRpcUpdateFromBanner.
    • Add NetworksForm tests to assert event emission and URL sanitization for public vs custom RPCs.

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

@cryptodev-2s cryptodev-2s requested a review from a team as a code owner November 12, 2025 14:35
@cryptodev-2s cryptodev-2s self-assigned this Nov 12, 2025
@cryptodev-2s cryptodev-2s requested a review from mcmire November 12, 2025 14:35
@github-actions
Copy link
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-core-platform Core Platform team label Nov 12, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-extension-ux (1 files, +6 -2)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 network-list-menu/
          • 📄 network-list-menu.tsx +6 -2

@cryptodev-2s cryptodev-2s changed the title metrics: Track when RPC update from network banner is completed feat: Track when RPC update from network banner is completed Nov 12, 2025
@cryptodev-2s cryptodev-2s force-pushed the metrics/track-network-banner-rpc-updated branch from 4a8230a to 5d75564 Compare November 12, 2025 14:37
@metamaskbot
Copy link
Collaborator

Builds ready [5d75564]
UI Startup Metrics (1217 ± 84 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1217106014198412621381
load105291812637810881206
domContentLoaded104691312597810821200
domInteractive221484161967
firstPaint67489121340710521160
backgroundConnect2272142718231241
firstReactRender26174862940
getState22869102840
initialActions001001
loadScripts824680103177868973
setupStore1172431218
numNetworkReqs1367419671
BrowserifyPower User HomeuiStartup16351469211421618992114
load1020897133416412701334
domContentLoaded1011888132316012541323
domInteractive45151975386197
firstPaint58117812914019141291
backgroundConnect24121927416253274
firstReactRender29243743437
getState17714923921189239
initialActions001011
loadScripts784662107615210151076
setupStore1392851328
numNetworkReqs1197623650169236
WebpackStandard HomeuiStartup8156951181988131108
load60855693293599904
domContentLoaded60155291589593884
domInteractive171191121445
firstPaint25658923247246887
backgroundConnect241172142456
firstReactRender28174473336
getState1162831215
initialActions001001
loadScripts59855090487591874
setupStore1164751318
numNetworkReqs1367319870
WebpackPower User HomeuiStartup1063889172823212141728
load69058611461588401146
domContentLoaded67057611121438051112
domInteractive34131103569110
firstPaint3626411153276021115
backgroundConnect48121824871182
firstReactRender28253322933
getState1417517529157175
initialActions001011
loadScripts66657411011407951101
setupStore1463192431
numNetworkReqs1107022557165225
FirefoxBrowserifyStandard HomeuiStartup14351282184111214931683
load1223110915088712791390
domContentLoaded1223110915078712791390
domInteractive1103547964109291
firstPaint------
backgroundConnect4125131185085
firstReactRender26214952741
getState1072731117
initialActions001001
loadScripts1198109014598112521350
setupStore1165671126
numNetworkReqs1266415755
BrowserifyPower User HomeuiStartup20471731317541220883175
load13111120170719614941707
domContentLoaded13111120170719614941707
domInteractive19480544172387544
firstPaint------
backgroundConnect1163280118491801
firstReactRender413065105165
getState1077113316119133
initialActions106116
loadScripts12831102167219014711672
setupStore23577234277
numNetworkReqs1367032173197321
WebpackStandard HomeuiStartup15611429200313015681879
load13351208168110013581574
domContentLoaded13341208168110013581574
domInteractive943321333112153
firstPaint------
backgroundConnect44231141948106
firstReactRender312476123174
getState127146151219
initialActions001001
loadScripts1308118916069013291526
setupStore17692171364
numNetworkReqs1367118767
WebpackPower User HomeuiStartup23361878345945226303459
load15411299189721818241897
domContentLoaded15411299189721818241897
domInteractive18038459143397459
firstPaint------
backgroundConnect1233832296166322
firstReactRender46356795367
getState1558538376204383
initialActions107217
loadScripts14851278183220817561832
setupStore3471233762123
numNetworkReqs1356532492226324
📊 Page Load Benchmark Results

Current Commit: 5d75564 | Date: 11/12/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±40ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 710ms (±37ms) 🟢 | historical mean value: 728ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 40ms 995ms 1.32s 1.04s 1.32s
domContentLoaded 710ms 37ms 689ms 993ms 729ms 993ms
firstPaint 75ms 11ms 60ms 168ms 84ms 168ms
firstContentfulPaint 75ms 11ms 60ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: 611 Bytes (0.01%)
  • common: 86 Bytes (0%)

Copy link
Contributor

@mcmire mcmire left a 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.

@mcmire
Copy link
Contributor

mcmire commented Nov 12, 2025

@cryptodev-2s We should make sure to add the new event to the segment-schema repo as well. There are some instructions for making a PR there: https://github.com/Consensys/segment-schema

@cryptodev-2s cryptodev-2s requested a review from mcmire November 12, 2025 19:34
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
@cryptodev-2s cryptodev-2s force-pushed the metrics/track-network-banner-rpc-updated branch from fb5a202 to f4cd43d Compare November 12, 2025 19:53
@metamaskbot
Copy link
Collaborator

Builds ready [f4cd43d]
UI Startup Metrics (1195 ± 85 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1195106914878512321350
load103391813128010791182
domContentLoaded102791513057910751171
domInteractive211495141760
firstPaint59184124440710271138
backgroundConnect2272142496229238
firstReactRender24174452536
getState21891112538
initialActions003001
loadScripts806691107479849949
setupStore1062731116
numNetworkReqs1367519672
BrowserifyPower User HomeuiStartup16771477236225219362362
load1058907168120512271681
domContentLoaded1046900161619412171616
domInteractive39151063688106
firstPaint61215316654509511665
backgroundConnect24622130423259304
firstReactRender29243833138
getState17112520318184203
initialActions001011
loadScripts81368313521849831352
setupStore15103171331
numNetworkReqs1607532795246327
WebpackStandard HomeuiStartup8267021176888291024
load61055897480604819
domContentLoaded60354895176600806
domInteractive171282121445
firstPaint20859955198202637
backgroundConnect251175152657
firstReactRender29186683438
getState1162931317
initialActions001001
loadScripts60054594173598795
setupStore1162231318
numNetworkReqs1367419872
WebpackPower User HomeuiStartup1081877160424612851604
load64657191394706913
domContentLoaded62855887385690873
domInteractive321396307196
firstPaint40276876270615876
backgroundConnect611020167161201
firstReactRender27243222832
getState1459018324156183
initialActions001011
loadScripts62455786282680862
setupStore116318931
numNetworkReqs1307222562208225
FirefoxBrowserifyStandard HomeuiStartup14751302200513015201745
load1247112115469212901449
domContentLoaded1246112115459212901448
domInteractive1103532454108238
firstPaint------
backgroundConnect4323133204998
firstReactRender26215952738
getState1174561120
initialActions0022211
loadScripts1220110015198712611417
setupStore1276171227
numNetworkReqs1267215759
BrowserifyPower User HomeuiStartup21841787312840425883128
load14091157192723316421927
domContentLoaded14091157192723316401927
domInteractive20647566190470566
firstPaint------
backgroundConnect952926977159269
firstReactRender42305884858
getState1458233474181334
initialActions20297129
loadScripts13751138181621916091816
setupStore28694294694
numNetworkReqs1366932188222321
WebpackStandard HomeuiStartup16791473243615817262033
load14171245185612014591681
domContentLoaded14171245185512014591681
domInteractive1043539557110205
firstPaint------
backgroundConnect54271983057129
firstReactRender352588123678
getState168214271220
initialActions001001
loadScripts13821213175011314341620
setupStore196224261670
numNetworkReqs1366917865
WebpackPower User HomeuiStartup21921847307431023043074
load14931254175117316821751
domContentLoaded14931254175017316811750
domInteractive15644527141278527
firstPaint------
backgroundConnect74272446572244
firstReactRender49331021855102
getState1409627944164279
initialActions101011
loadScripts14651236172517216641725
setupStore3661814359181
numNetworkReqs1346630879231308
📊 Page Load Benchmark Results

Current Commit: f4cd43d | Date: 11/12/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±43ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 720ms (±58ms) 🟢 | historical mean value: 726ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 88ms (±124ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 43ms 1.01s 1.39s 1.04s 1.39s
domContentLoaded 720ms 58ms 695ms 1.26s 728ms 1.26s
firstPaint 88ms 124ms 60ms 1.32s 88ms 1.32s
firstContentfulPaint 88ms 124ms 60ms 1.32s 88ms 1.32s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 570 Bytes (0.01%)
  • common: 96 Bytes (0%)

@cryptodev-2s
Copy link
Contributor Author

@cryptodev-2s We should make sure to add the new event to the segment-schema repo as well. There are some instructions for making a PR there: https://github.com/Consensys/segment-schema

Done here https://github.com/Consensys/segment-schema/pull/366

@cryptodev-2s
Copy link
Contributor Author

cryptodev-2s commented Nov 13, 2025

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants