feat: suppress RPC connection banner during single-provider outages (WPC-1014)#43073
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. |
Builds ready [d1c417d]
⚡ Performance Benchmarks (Total: 🟢 23 pass · 🟡 2 warn · 🔴 0 fail)
Bundle size diffs
|
d1c417d to
b563077
Compare
Builds ready [b563077]
⚡ Performance Benchmarks (Total: 🟢 23 pass · 🟡 2 warn · 🔴 0 fail)
Bundle size diffs
|
b563077 to
19fc653
Compare
19fc653 to
793c0e2
Compare
Builds ready [793c0e2]
⚡ Performance Benchmarks (Total: 🟢 22 pass · 🟡 3 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
793c0e2 to
3f5e250
Compare
Builds ready [3f5e250] [reused from 793c0e2]
⚡ Performance Benchmarks (Total: 🟢 22 pass · 🟡 3 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
4965af0 to
bd13d34
Compare
Builds ready [bd13d34]
⚡ Performance Benchmarks (Total: 🟢 22 pass · 🟡 2 warn · 🔴 0 fail)
Bundle size diffs
|
bd13d34 to
bdb2847
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Builds ready [e73f5a7]
⚡ Performance Benchmarks (Total: 🟢 23 pass · 🟡 2 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
mcmire
left a comment
There was a problem hiding this comment.
Getting closer. Still need to review the tests. Here are some more comments in the meantime.
| @@ -0,0 +1,17 @@ | |||
| // psl ships its own types at psl/types/index.d.ts, but its package.json | |||
There was a problem hiding this comment.
Ugh. Looks like a types field has been added here: https://github.com/lupomontero/psl/blob/2a3d53f3ba63c6e503da54b835a8dcac681668cd/package.json#L13. But it hasn't been included in a release anywhere. What a shame.
Builds ready [4a99b91]
⚡ Performance Benchmarks (Total: 🟢 23 pass · 🟡 2 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
The "Still connecting" / "Unable to connect" banner currently fires whenever any single enabled EVM network's default RPC is unavailable for >5s. With "All popular networks" selected (the default), the client polls every popular chain every ~30s, so a single transient Infura blip pops the banner. Worse, when Infura itself has a wide outage, many networks fail simultaneously and the user sees the banner even though it's really one provider hiccup, not a wallet-wide problem.
This PR keeps the existing banner UI, timer thresholds, and analytics untouched and only changes the show/hide rule. The banner now shows when:
*.infura.iocollapse to one),A network is "failed" here when its default RPC endpoint's metadata status is anything other than
NetworkStatus.Available. The word "unavailable" is reserved for the specificNetworkStatus.Unavailablecircuit-broken state and the banner's own'degraded' | 'unavailable'state machine.When the custom override fires alongside an Infura outage, the custom network is surfaced first so the "Switch to MetaMask default RPC" CTA targets the one the user can act on.
Implementation:
getDomainhelper inshared/lib/url-utils.tsbacked by thepsllibrary (already a transitive dep, promoted to a direct dep here). Handles multi-part public suffixes like.co.uk. Localhost and IP literals short-circuit to the hostname so callers grouping by domain can still distinguish them.isLocalhostOrIPAddresshelper fromapp/scripts/lib/util.tstoshared/lib/url-utils.tsso it can be reused for the short-circuit. No behavior change for its existing caller (isPublicEndpointUrl).selectFirstUnavailableEvmNetwork→selectFirstFailedNetworkForNetworkConnectionBannerand split into three composed layers:selectEnhancedNetworkConfigurationsByChainId(annotates every RPC endpoint withisInfuraEndpoint/isFailed/domain),selectEnabledFailedNetworksResult(the failed subset for enabled EVM networks + anareAllEnabledNetworksFailedflag), and the top-level selector which is now just the show-banner rule.bannerNetwork→failedNetwork).Changelog
CHANGELOG entry: Reduced false-positive RPC connection banners — single-provider outages no longer pop the banner, even when many popular networks fail at once.
Related issues
Fixes: WPC-1014
Manual testing steps
*.infura.iohosts. Wait 5+ seconds. Expect: no banner (one domain, suppressed).*.infura.ioand an Alchemy or QuickNode RPC simultaneously. Expect: degraded banner at 5s, unavailable at 30s (2 distinct domains).Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes when users see connectivity warnings during RPC outages; logic is well-tested but mis-grouping domains could hide real issues or show banners too often.
Overview
Suppresses false-positive RPC connection banners by changing only which failures drive the existing degraded/unavailable UI and timers (WPC-1014).
The banner selector is renamed to
selectFirstFailedNetworkForNetworkConnectionBannerand refactored into layers that annotate each default RPC with Infura vs custom, failed (status ≠Available), and registrable domain via newgetDomaininshared/lib/url-utils.ts(Public Suffix List viapsl). The banner shows when failures span 2+ domains, every enabled EVM network has failed, or any failed default is a custom RPC (custom failures are preferred for the Infura switch CTA). Single-provider outages (e.g. many*.infura.ionetworks down while others are healthy) no longer trigger the banner.isLocalhostOrIPAddressmoves fromapp/scripts/lib/util.tstourl-utilsfor reuse;useNetworkConnectionBanneronly updates imports/variable names.Reviewed by Cursor Bugbot for commit 4a99b91. Bugbot is set up for automated code reviews on this repo. Configure here.