feat: suppress RPC connection banner during single-provider outages (WPC-1014)#31047
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
e8b620e to
c1ac503
Compare
ac6604b to
d93a635
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d93a635. Configure here.
…, not the default" This reverts commit 931c401.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |

Description
The "Still connecting" / "Unable to connect" banner fires today whenever any one enabled EVM network's default RPC is unavailable, which means a single Infura blip — or a wide Infura outage that takes down many
*.infura.ionetworks at once — pops a banner that doesn't reflect anything the user can act on.This PR keeps the banner UI, timer thresholds, and analytics untouched and only changes the show/hide rule. The banner now shows when failed RPCs span 2+ distinct registrable domains (eTLD+1 via the Public Suffix List), or every enabled EVM network has failed (so single-network setups still get a signal), or any failed RPC is a non-Infura (custom) endpoint — those have no automatic failover. When a custom failure exists, it's surfaced first so the "Switch to MetaMask default RPC" CTA targets the one the user can act on.
Mobile counterpart to extension PR #43073. Same rule, kept inline in
useNetworkConnectionBannerrather than split into composed selectors.Implementation:
app/util/url-utils.tsexposinggetDomain(psl-backed eTLD+1) andisLocalhostOrIPAddress(ip-regex-backed). Localhost, IP literals, and single-label hosts short-circuit so callers grouping by domain can still distinguish them.useNetworkConnectionBanner.checkNetworkStatuscollects every failing enabled EVM network instead of breaking on the first, counts distinct domains, and applies the new rule.psl,ip-regex(the latter added totransformIgnorePatternssince it ships ESM-only).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
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Note
Low Risk
Connectivity UX only—no auth, payments, or transaction signing; behavior is covered by new hook and url-utils tests, with main risk being under-alerting if domain grouping misclassifies an outage.
Overview
Reduces false-positive “Still connecting” / RPC connection banners by changing only when the banner is shown or hidden; timers, UI, and analytics stay the same.
useNetworkConnectionBannernow scans all enabled EVM networks with a failing default RPC (not just the first), derives each endpoint’s registrable domain via newapp/util/url-utils(getDomain+ Public Suffix List viapsl), and shows the banner only when a custom default RPC is down, failures span more than one provider domain, or every enabled network is failing. A wide single-provider outage (e.g. many*.infura.ionetworks) counts as one domain and is suppressed unless the user’s whole enabled set is on that provider; when showing, a custom failure is preferred for the switch-to-default CTA. The hook hides an existing banner when the situation no longer meets those rules (e.g. custom RPC recovers and only one Infura network is down).Adds
ip-regexandpsl, Jest allowlisting forip-regex, and unit tests for the new rules andurl-utils.Reviewed by Cursor Bugbot for commit 675ea31. Bugbot is set up for automated code reviews on this repo. Configure here.