Skip to content

feat: add @metamask/network-connection-banner-controller - #9041

Merged
cryptodev-2s merged 75 commits into
mainfrom
wpc-1014-network-connection-banner-controller
Jul 8, 2026
Merged

feat: add @metamask/network-connection-banner-controller#9041
cryptodev-2s merged 75 commits into
mainfrom
wpc-1014-network-connection-banner-controller

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Explanation

The RPC connection banner ("Still connecting" / "Unable to connect") is currently rendered by both metamask-extension and metamask-mobile based on duplicated logic in each repo:

  • The 5s / 30s timer state machine.
  • The show/hide rule (custom-RPC override, ≥2 distinct registrable domains failing, or all-enabled-failed escape hatch).
  • eTLD+1 grouping via psl so a single provider's wide outage doesn't pop the banner.
  • Infura URL detection.
  • The { chainId, networkName, rpcUrl, isInfuraEndpoint, infuraNetworkClientId } payload shape.

This PR introduces @metamask/network-connection-banner-controller so there's a single source of truth. The controller:

  • Subscribes to NetworkController:stateChanged, NetworkEnablementController:stateChanged, and ConnectivityController:stateChanged via the messenger.
  • Runs the 5s/30s escalation timers internally.
  • Exposes a flat state { status: 'available' | 'degraded' | 'unavailable', network: FailedNetwork | null } that clients subscribe to.
  • Exposes two messenger actions: dismissBanner() and switchToDefaultInfuraRpc({ chainId }) — the latter looks up the chain's first Infura endpoint and calls NetworkController:updateNetwork with replacementSelectedRpcEndpointIndex.
  • Stays analytics-free; clients diff state-change events into their own analytics translation.

psl 1.15 ships its types field outside its exports map so TypeScript's node16 module resolution can't find it; a small ambient src/psl.d.ts shim mirrors the workaround already in use in extension and mobile. ip-regex is pinned to ^4.3.0 (last CJS release) because the monorepo's Jest config doesn't transform ESM-only deps.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
The controller can change active RPC and default endpoints via NetworkController, which affects wallet connectivity; behavior is complex but heavily tested and gated on UI/unlock lifecycle.

Overview
Adds @metamask/network-connection-banner-controller as the shared source of truth for the RPC connection banner, replacing duplicated extension/mobile logic.

NetworkConnectionBannerController watches enabled EVM networks’ default RPC health (via NetworkController, NetworkEnablementController, and ConnectivityController), applies a 5s → 30s escalation to degraded / unavailable, and exposes ephemeral UI state (networkConnectionBannerStatus, networkConnectionBannerNetwork). The banner is shown when a custom RPC is failing or every enabled network is down; isolated Infura blips among healthy peers are suppressed. Evaluation runs only while the UI is open and the wallet is unlocked (ClientController, KeyringController).

Messenger actions dismissBanner and switchToDefaultInfuraRpcEndpoint let users hide the banner or switch the active connection to Infura and update the chain’s default RPC (active network first, then updateNetwork). getIsInfuraEndpoint classifies MetaMask Infura URLs for that flow.

Monorepo wiring includes CODEOWNERS, README dependency graph, teams.json, and tsconfig references. A root types/psl.d.ts shim supports TypeScript resolution for psl.

Reviewed by Cursor Bugbot for commit 3d3018f. Bugbot is set up for automated code reviews on this repo. Configure here.

@cryptodev-2s
cryptodev-2s force-pushed the wpc-1014-network-connection-banner-controller branch 2 times, most recently from 9111156 to d1fa945 Compare June 8, 2026 16:31
@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.5.1-preview-7507a11
@metamask-previews/accounts-controller@39.0.0-preview-7507a11
@metamask-previews/address-book-controller@7.1.2-preview-7507a11
@metamask-previews/ai-controllers@0.7.0-preview-7507a11
@metamask-previews/analytics-controller@1.1.1-preview-7507a11
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-7507a11
@metamask-previews/announcement-controller@8.1.0-preview-7507a11
@metamask-previews/app-metadata-controller@2.0.1-preview-7507a11
@metamask-previews/approval-controller@9.0.1-preview-7507a11
@metamask-previews/assets-controller@8.3.2-preview-7507a11
@metamask-previews/assets-controllers@108.5.0-preview-7507a11
@metamask-previews/authenticated-user-storage@2.0.0-preview-7507a11
@metamask-previews/base-controller@9.1.0-preview-7507a11
@metamask-previews/base-data-service@0.1.3-preview-7507a11
@metamask-previews/bridge-controller@73.2.1-preview-7507a11
@metamask-previews/bridge-status-controller@72.0.2-preview-7507a11
@metamask-previews/build-utils@3.0.4-preview-7507a11
@metamask-previews/chain-agnostic-permission@1.6.1-preview-7507a11
@metamask-previews/chomp-api-service@3.1.0-preview-7507a11
@metamask-previews/claims-controller@0.5.2-preview-7507a11
@metamask-previews/client-controller@1.0.1-preview-7507a11
@metamask-previews/compliance-controller@2.1.0-preview-7507a11
@metamask-previews/composable-controller@12.0.1-preview-7507a11
@metamask-previews/config-registry-controller@0.4.0-preview-7507a11
@metamask-previews/connectivity-controller@0.2.0-preview-7507a11
@metamask-previews/controller-utils@12.1.0-preview-7507a11
@metamask-previews/core-backend@6.3.2-preview-7507a11
@metamask-previews/delegation-controller@3.0.1-preview-7507a11
@metamask-previews/earn-controller@12.2.0-preview-7507a11
@metamask-previews/eip-5792-middleware@3.0.4-preview-7507a11
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-7507a11
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-7507a11
@metamask-previews/ens-controller@19.1.3-preview-7507a11
@metamask-previews/eth-block-tracker@15.0.1-preview-7507a11
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-7507a11
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-7507a11
@metamask-previews/foundryup@1.0.1-preview-7507a11
@metamask-previews/gas-fee-controller@26.2.2-preview-7507a11
@metamask-previews/gator-permissions-controller@4.2.0-preview-7507a11
@metamask-previews/geolocation-controller@0.1.3-preview-7507a11
@metamask-previews/json-rpc-engine@10.5.0-preview-7507a11
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-7507a11
@metamask-previews/keyring-controller@26.0.0-preview-7507a11
@metamask-previews/logging-controller@8.0.2-preview-7507a11
@metamask-previews/message-manager@14.1.2-preview-7507a11
@metamask-previews/messenger@1.2.0-preview-7507a11
@metamask-previews/messenger-cli@0.2.0-preview-7507a11
@metamask-previews/money-account-balance-service@1.0.2-preview-7507a11
@metamask-previews/money-account-controller@0.3.2-preview-7507a11
@metamask-previews/money-account-upgrade-controller@2.0.3-preview-7507a11
@metamask-previews/multichain-account-service@10.0.2-preview-7507a11
@metamask-previews/multichain-api-middleware@3.1.3-preview-7507a11
@metamask-previews/multichain-network-controller@3.1.3-preview-7507a11
@metamask-previews/multichain-transactions-controller@7.1.1-preview-7507a11
@metamask-previews/name-controller@9.1.2-preview-7507a11
@metamask-previews/network-connection-banner-controller@0.1.0-preview-7507a11
@metamask-previews/network-controller@32.0.0-preview-7507a11
@metamask-previews/network-enablement-controller@5.3.0-preview-7507a11
@metamask-previews/notification-services-controller@24.1.2-preview-7507a11
@metamask-previews/passkey-controller@2.0.1-preview-7507a11
@metamask-previews/permission-controller@13.1.1-preview-7507a11
@metamask-previews/permission-log-controller@5.1.0-preview-7507a11
@metamask-previews/perps-controller@8.0.0-preview-7507a11
@metamask-previews/phishing-controller@17.2.0-preview-7507a11
@metamask-previews/polling-controller@16.0.6-preview-7507a11
@metamask-previews/preferences-controller@23.1.0-preview-7507a11
@metamask-previews/profile-metrics-controller@3.1.6-preview-7507a11
@metamask-previews/profile-sync-controller@28.1.1-preview-7507a11
@metamask-previews/ramps-controller@14.1.1-preview-7507a11
@metamask-previews/rate-limit-controller@7.0.1-preview-7507a11
@metamask-previews/react-data-query@0.2.1-preview-7507a11
@metamask-previews/remote-feature-flag-controller@4.2.2-preview-7507a11
@metamask-previews/sample-controllers@5.0.1-preview-7507a11
@metamask-previews/seedless-onboarding-controller@10.0.1-preview-7507a11
@metamask-previews/selected-network-controller@26.1.3-preview-7507a11
@metamask-previews/shield-controller@5.1.2-preview-7507a11
@metamask-previews/signature-controller@39.2.4-preview-7507a11
@metamask-previews/snap-account-service@0.3.0-preview-7507a11
@metamask-previews/social-controllers@2.2.1-preview-7507a11
@metamask-previews/storage-service@1.0.1-preview-7507a11
@metamask-previews/subscription-controller@6.1.3-preview-7507a11
@metamask-previews/transaction-controller@67.0.0-preview-7507a11
@metamask-previews/transaction-pay-controller@23.3.0-preview-7507a11
@metamask-previews/user-operation-controller@41.2.3-preview-7507a11
@metamask-previews/wallet@2.0.0-preview-7507a11

@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@cryptodev-2s
cryptodev-2s marked this pull request as ready for review June 10, 2026 21:29
@cryptodev-2s
cryptodev-2s requested a review from a team as a code owner June 10, 2026 21:29
@cryptodev-2s cryptodev-2s self-assigned this Jun 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.5.2-preview-69c25f142
@metamask-previews/accounts-controller@39.0.1-preview-69c25f142
@metamask-previews/address-book-controller@7.1.2-preview-69c25f142
@metamask-previews/ai-controllers@0.7.0-preview-69c25f142
@metamask-previews/analytics-controller@1.1.1-preview-69c25f142
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-69c25f142
@metamask-previews/announcement-controller@8.1.0-preview-69c25f142
@metamask-previews/app-metadata-controller@2.0.1-preview-69c25f142
@metamask-previews/approval-controller@9.0.2-preview-69c25f142
@metamask-previews/assets-controller@9.0.1-preview-69c25f142
@metamask-previews/assets-controllers@109.0.0-preview-69c25f142
@metamask-previews/authenticated-user-storage@2.0.0-preview-69c25f142
@metamask-previews/base-controller@9.1.0-preview-69c25f142
@metamask-previews/base-data-service@0.1.3-preview-69c25f142
@metamask-previews/bridge-controller@75.1.1-preview-69c25f142
@metamask-previews/bridge-status-controller@72.1.0-preview-69c25f142
@metamask-previews/build-utils@3.0.4-preview-69c25f142
@metamask-previews/chain-agnostic-permission@1.6.1-preview-69c25f142
@metamask-previews/chomp-api-service@3.1.0-preview-69c25f142
@metamask-previews/claims-controller@0.5.3-preview-69c25f142
@metamask-previews/client-controller@1.0.1-preview-69c25f142
@metamask-previews/compliance-controller@2.1.0-preview-69c25f142
@metamask-previews/composable-controller@12.0.1-preview-69c25f142
@metamask-previews/config-registry-controller@0.4.1-preview-69c25f142
@metamask-previews/connectivity-controller@0.2.0-preview-69c25f142
@metamask-previews/controller-utils@12.2.0-preview-69c25f142
@metamask-previews/core-backend@6.3.3-preview-69c25f142
@metamask-previews/delegation-controller@3.0.2-preview-69c25f142
@metamask-previews/earn-controller@12.2.0-preview-69c25f142
@metamask-previews/eip-5792-middleware@3.0.4-preview-69c25f142
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-69c25f142
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-69c25f142
@metamask-previews/ens-controller@19.1.3-preview-69c25f142
@metamask-previews/eth-block-tracker@15.0.1-preview-69c25f142
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-69c25f142
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-69c25f142
@metamask-previews/foundryup@1.0.1-preview-69c25f142
@metamask-previews/gas-fee-controller@26.2.2-preview-69c25f142
@metamask-previews/gator-permissions-controller@4.2.0-preview-69c25f142
@metamask-previews/geolocation-controller@0.1.3-preview-69c25f142
@metamask-previews/json-rpc-engine@10.5.0-preview-69c25f142
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-69c25f142
@metamask-previews/keyring-controller@27.0.0-preview-69c25f142
@metamask-previews/logging-controller@8.0.2-preview-69c25f142
@metamask-previews/message-manager@14.1.2-preview-69c25f142
@metamask-previews/messenger@1.2.0-preview-69c25f142
@metamask-previews/messenger-cli@0.2.0-preview-69c25f142
@metamask-previews/money-account-balance-service@1.0.2-preview-69c25f142
@metamask-previews/money-account-controller@0.3.3-preview-69c25f142
@metamask-previews/money-account-upgrade-controller@2.0.4-preview-69c25f142
@metamask-previews/multichain-account-service@10.0.3-preview-69c25f142
@metamask-previews/multichain-api-middleware@3.1.3-preview-69c25f142
@metamask-previews/multichain-network-controller@3.1.3-preview-69c25f142
@metamask-previews/multichain-transactions-controller@7.1.1-preview-69c25f142
@metamask-previews/name-controller@9.1.2-preview-69c25f142
@metamask-previews/network-connection-banner-controller@0.1.0-preview-69c25f142
@metamask-previews/network-controller@32.0.0-preview-69c25f142
@metamask-previews/network-enablement-controller@5.3.0-preview-69c25f142
@metamask-previews/notification-services-controller@24.1.3-preview-69c25f142
@metamask-previews/passkey-controller@2.0.1-preview-69c25f142
@metamask-previews/permission-controller@13.1.1-preview-69c25f142
@metamask-previews/permission-log-controller@5.1.0-preview-69c25f142
@metamask-previews/perps-controller@8.0.0-preview-69c25f142
@metamask-previews/phishing-controller@17.2.0-preview-69c25f142
@metamask-previews/polling-controller@16.0.6-preview-69c25f142
@metamask-previews/preferences-controller@23.1.0-preview-69c25f142
@metamask-previews/profile-metrics-controller@3.2.0-preview-69c25f142
@metamask-previews/profile-sync-controller@28.1.1-preview-69c25f142
@metamask-previews/ramps-controller@14.1.1-preview-69c25f142
@metamask-previews/rate-limit-controller@7.0.1-preview-69c25f142
@metamask-previews/react-data-query@0.2.1-preview-69c25f142
@metamask-previews/remote-feature-flag-controller@4.2.2-preview-69c25f142
@metamask-previews/sample-controllers@5.0.1-preview-69c25f142
@metamask-previews/seedless-onboarding-controller@10.0.2-preview-69c25f142
@metamask-previews/selected-network-controller@26.1.3-preview-69c25f142
@metamask-previews/shield-controller@5.1.2-preview-69c25f142
@metamask-previews/signature-controller@39.2.5-preview-69c25f142
@metamask-previews/snap-account-service@0.3.1-preview-69c25f142
@metamask-previews/social-controllers@2.2.1-preview-69c25f142
@metamask-previews/storage-service@1.0.2-preview-69c25f142
@metamask-previews/subscription-controller@6.1.3-preview-69c25f142
@metamask-previews/transaction-controller@67.1.0-preview-69c25f142
@metamask-previews/transaction-pay-controller@23.5.1-preview-69c25f142
@metamask-previews/user-operation-controller@41.2.4-preview-69c25f142
@metamask-previews/wallet@3.0.0-preview-69c25f142

@cryptodev-2s

This comment was marked as outdated.

@cryptodev-2s
cryptodev-2s force-pushed the wpc-1014-network-connection-banner-controller branch from 6d2ab14 to 2fc626b Compare June 10, 2026 22:43
@cryptodev-2s

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.5.2-preview-fe651cdb3
@metamask-previews/accounts-controller@39.0.1-preview-fe651cdb3
@metamask-previews/address-book-controller@7.1.2-preview-fe651cdb3
@metamask-previews/ai-controllers@0.7.0-preview-fe651cdb3
@metamask-previews/analytics-controller@1.1.1-preview-fe651cdb3
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-fe651cdb3
@metamask-previews/announcement-controller@8.1.0-preview-fe651cdb3
@metamask-previews/app-metadata-controller@2.0.1-preview-fe651cdb3
@metamask-previews/approval-controller@9.0.2-preview-fe651cdb3
@metamask-previews/assets-controller@9.0.1-preview-fe651cdb3
@metamask-previews/assets-controllers@109.0.0-preview-fe651cdb3
@metamask-previews/authenticated-user-storage@2.0.0-preview-fe651cdb3
@metamask-previews/base-controller@9.1.0-preview-fe651cdb3
@metamask-previews/base-data-service@0.1.3-preview-fe651cdb3
@metamask-previews/bridge-controller@75.1.1-preview-fe651cdb3
@metamask-previews/bridge-status-controller@72.1.0-preview-fe651cdb3
@metamask-previews/build-utils@3.0.4-preview-fe651cdb3
@metamask-previews/chain-agnostic-permission@1.6.1-preview-fe651cdb3
@metamask-previews/chomp-api-service@3.1.0-preview-fe651cdb3
@metamask-previews/claims-controller@0.5.3-preview-fe651cdb3
@metamask-previews/client-controller@1.0.1-preview-fe651cdb3
@metamask-previews/compliance-controller@2.1.0-preview-fe651cdb3
@metamask-previews/composable-controller@12.0.1-preview-fe651cdb3
@metamask-previews/config-registry-controller@0.4.1-preview-fe651cdb3
@metamask-previews/connectivity-controller@0.2.0-preview-fe651cdb3
@metamask-previews/controller-utils@12.2.0-preview-fe651cdb3
@metamask-previews/core-backend@6.3.3-preview-fe651cdb3
@metamask-previews/delegation-controller@3.0.2-preview-fe651cdb3
@metamask-previews/earn-controller@12.2.0-preview-fe651cdb3
@metamask-previews/eip-5792-middleware@3.0.4-preview-fe651cdb3
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-fe651cdb3
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-fe651cdb3
@metamask-previews/ens-controller@19.1.3-preview-fe651cdb3
@metamask-previews/eth-block-tracker@15.0.1-preview-fe651cdb3
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-fe651cdb3
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-fe651cdb3
@metamask-previews/foundryup@1.0.1-preview-fe651cdb3
@metamask-previews/gas-fee-controller@26.2.2-preview-fe651cdb3
@metamask-previews/gator-permissions-controller@4.2.0-preview-fe651cdb3
@metamask-previews/geolocation-controller@0.1.3-preview-fe651cdb3
@metamask-previews/json-rpc-engine@10.5.0-preview-fe651cdb3
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-fe651cdb3
@metamask-previews/keyring-controller@27.0.0-preview-fe651cdb3
@metamask-previews/logging-controller@8.0.2-preview-fe651cdb3
@metamask-previews/message-manager@14.1.2-preview-fe651cdb3
@metamask-previews/messenger@1.2.0-preview-fe651cdb3
@metamask-previews/messenger-cli@0.2.0-preview-fe651cdb3
@metamask-previews/money-account-balance-service@1.0.2-preview-fe651cdb3
@metamask-previews/money-account-controller@0.3.3-preview-fe651cdb3
@metamask-previews/money-account-upgrade-controller@2.0.5-preview-fe651cdb3
@metamask-previews/multichain-account-service@10.0.3-preview-fe651cdb3
@metamask-previews/multichain-api-middleware@3.1.3-preview-fe651cdb3
@metamask-previews/multichain-network-controller@3.1.3-preview-fe651cdb3
@metamask-previews/multichain-transactions-controller@7.1.1-preview-fe651cdb3
@metamask-previews/name-controller@9.1.2-preview-fe651cdb3
@metamask-previews/network-connection-banner-controller@0.1.0-preview-fe651cdb3
@metamask-previews/network-controller@32.0.0-preview-fe651cdb3
@metamask-previews/network-enablement-controller@5.3.0-preview-fe651cdb3
@metamask-previews/notification-services-controller@24.1.3-preview-fe651cdb3
@metamask-previews/passkey-controller@2.0.1-preview-fe651cdb3
@metamask-previews/permission-controller@13.1.1-preview-fe651cdb3
@metamask-previews/permission-log-controller@5.1.0-preview-fe651cdb3
@metamask-previews/perps-controller@8.1.0-preview-fe651cdb3
@metamask-previews/phishing-controller@17.2.0-preview-fe651cdb3
@metamask-previews/polling-controller@16.0.6-preview-fe651cdb3
@metamask-previews/preferences-controller@23.1.0-preview-fe651cdb3
@metamask-previews/profile-metrics-controller@3.2.0-preview-fe651cdb3
@metamask-previews/profile-sync-controller@28.1.1-preview-fe651cdb3
@metamask-previews/ramps-controller@14.1.1-preview-fe651cdb3
@metamask-previews/rate-limit-controller@7.0.1-preview-fe651cdb3
@metamask-previews/react-data-query@0.2.1-preview-fe651cdb3
@metamask-previews/remote-feature-flag-controller@4.2.2-preview-fe651cdb3
@metamask-previews/sample-controllers@5.0.1-preview-fe651cdb3
@metamask-previews/seedless-onboarding-controller@10.0.2-preview-fe651cdb3
@metamask-previews/selected-network-controller@26.1.3-preview-fe651cdb3
@metamask-previews/shield-controller@5.1.2-preview-fe651cdb3
@metamask-previews/signature-controller@39.2.5-preview-fe651cdb3
@metamask-previews/snap-account-service@0.3.1-preview-fe651cdb3
@metamask-previews/social-controllers@2.2.1-preview-fe651cdb3
@metamask-previews/storage-service@1.0.2-preview-fe651cdb3
@metamask-previews/subscription-controller@6.1.3-preview-fe651cdb3
@metamask-previews/transaction-controller@68.0.0-preview-fe651cdb3
@metamask-previews/transaction-pay-controller@23.5.1-preview-fe651cdb3
@metamask-previews/user-operation-controller@41.2.4-preview-fe651cdb3
@metamask-previews/wallet@3.0.0-preview-fe651cdb3

replacementSelectedRpcEndpointIndex exists to keep the selected network
valid when an RPC endpoint is removed, and nothing is removed here.
switchToDefaultInfuraRpcEndpoint now updates the default index and then
calls NetworkController:setActiveNetwork itself (skipping the call when
the Infura endpoint is already selected), which also makes the network
switch visible at a glance.
@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

cryptodev-2s and others added 3 commits July 7, 2026 15:40
Some flows persist MetaMask Infura URLs with the wallet's project id
already substituted (adding a popular network stores a custom typed
endpoint that way), so the placeholder match alone misclassified them as
custom and surfaced the banner with an Update RPC prompt for our own
managed endpoint. The controller now takes infuraProjectId and
getIsInfuraEndpoint matches both shapes, mirroring the extension's
getIsMetaMaskInfuraEndpointUrl. URLs carrying a different project id
still count as custom since they run on the user's own account.
In this order a partial failure leaves the failing default in place and
the banner visible, instead of hiding the banner while the wallet is
still connected to the broken endpoint.
@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.5.3-preview-c4108f3eb
@metamask-previews/accounts-controller@39.0.4-preview-c4108f3eb
@metamask-previews/address-book-controller@7.1.2-preview-c4108f3eb
@metamask-previews/ai-controllers@0.7.0-preview-c4108f3eb
@metamask-previews/analytics-controller@1.2.1-preview-c4108f3eb
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-c4108f3eb
@metamask-previews/announcement-controller@8.1.0-preview-c4108f3eb
@metamask-previews/app-metadata-controller@2.0.1-preview-c4108f3eb
@metamask-previews/approval-controller@9.0.2-preview-c4108f3eb
@metamask-previews/assets-controller@10.0.1-preview-c4108f3eb
@metamask-previews/assets-controllers@109.3.0-preview-c4108f3eb
@metamask-previews/authenticated-user-storage@3.0.0-preview-c4108f3eb
@metamask-previews/base-controller@9.1.0-preview-c4108f3eb
@metamask-previews/base-data-service@0.1.3-preview-c4108f3eb
@metamask-previews/bitcoin-regtest-up@1.0.0-preview-c4108f3eb
@metamask-previews/bridge-controller@77.3.2-preview-c4108f3eb
@metamask-previews/bridge-status-controller@74.0.2-preview-c4108f3eb
@metamask-previews/build-utils@3.0.4-preview-c4108f3eb
@metamask-previews/chain-agnostic-permission@1.7.0-preview-c4108f3eb
@metamask-previews/chomp-api-service@3.1.0-preview-c4108f3eb
@metamask-previews/claims-controller@0.5.3-preview-c4108f3eb
@metamask-previews/client-controller@1.0.1-preview-c4108f3eb
@metamask-previews/client-utils@0.0.0-preview-c4108f3eb
@metamask-previews/compliance-controller@2.1.0-preview-c4108f3eb
@metamask-previews/composable-controller@12.0.1-preview-c4108f3eb
@metamask-previews/config-registry-controller@0.4.1-preview-c4108f3eb
@metamask-previews/connectivity-controller@0.2.0-preview-c4108f3eb
@metamask-previews/controller-utils@12.3.0-preview-c4108f3eb
@metamask-previews/core-backend@6.5.0-preview-c4108f3eb
@metamask-previews/delegation-controller@3.0.2-preview-c4108f3eb
@metamask-previews/earn-controller@12.2.2-preview-c4108f3eb
@metamask-previews/eip-5792-middleware@3.0.4-preview-c4108f3eb
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.1-preview-c4108f3eb
@metamask-previews/eip1193-permission-middleware@2.0.1-preview-c4108f3eb
@metamask-previews/ens-controller@19.1.5-preview-c4108f3eb
@metamask-previews/eth-block-tracker@15.0.1-preview-c4108f3eb
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-c4108f3eb
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-c4108f3eb
@metamask-previews/foundryup@1.0.1-preview-c4108f3eb
@metamask-previews/gas-fee-controller@26.2.4-preview-c4108f3eb
@metamask-previews/gator-permissions-controller@4.2.2-preview-c4108f3eb
@metamask-previews/geolocation-controller@0.1.3-preview-c4108f3eb
@metamask-previews/java-tron-up@1.0.0-preview-c4108f3eb
@metamask-previews/json-rpc-engine@10.5.0-preview-c4108f3eb
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-c4108f3eb
@metamask-previews/keyring-controller@27.1.0-preview-c4108f3eb
@metamask-previews/local-node-utils@1.0.0-preview-c4108f3eb
@metamask-previews/logging-controller@8.0.2-preview-c4108f3eb
@metamask-previews/message-manager@14.1.2-preview-c4108f3eb
@metamask-previews/messenger@2.0.0-preview-c4108f3eb
@metamask-previews/messenger-cli@0.2.0-preview-c4108f3eb
@metamask-previews/money-account-api-data-service@0.0.0-preview-c4108f3eb
@metamask-previews/money-account-balance-service@2.1.2-preview-c4108f3eb
@metamask-previews/money-account-controller@0.3.3-preview-c4108f3eb
@metamask-previews/money-account-upgrade-controller@2.2.1-preview-c4108f3eb
@metamask-previews/multichain-account-service@11.1.0-preview-c4108f3eb
@metamask-previews/multichain-api-middleware@4.0.1-preview-c4108f3eb
@metamask-previews/multichain-network-controller@3.2.1-preview-c4108f3eb
@metamask-previews/multichain-transactions-controller@7.1.1-preview-c4108f3eb
@metamask-previews/name-controller@9.1.2-preview-c4108f3eb
@metamask-previews/network-connection-banner-controller@0.1.0-preview-c4108f3eb
@metamask-previews/network-controller@34.0.0-preview-c4108f3eb
@metamask-previews/network-enablement-controller@5.4.1-preview-c4108f3eb
@metamask-previews/notification-services-controller@24.3.0-preview-c4108f3eb
@metamask-previews/passkey-controller@2.0.1-preview-c4108f3eb
@metamask-previews/permission-controller@13.1.1-preview-c4108f3eb
@metamask-previews/permission-log-controller@5.1.0-preview-c4108f3eb
@metamask-previews/perps-controller@9.2.1-preview-c4108f3eb
@metamask-previews/phishing-controller@17.2.0-preview-c4108f3eb
@metamask-previews/platform-api-docs@0.0.0-preview-c4108f3eb
@metamask-previews/polling-controller@16.0.8-preview-c4108f3eb
@metamask-previews/preferences-controller@23.1.0-preview-c4108f3eb
@metamask-previews/profile-metrics-controller@4.0.1-preview-c4108f3eb
@metamask-previews/profile-sync-controller@28.2.0-preview-c4108f3eb
@metamask-previews/ramps-controller@15.1.0-preview-c4108f3eb
@metamask-previews/rate-limit-controller@7.0.1-preview-c4108f3eb
@metamask-previews/react-data-query@0.2.1-preview-c4108f3eb
@metamask-previews/remote-feature-flag-controller@4.2.2-preview-c4108f3eb
@metamask-previews/sample-controllers@5.0.3-preview-c4108f3eb
@metamask-previews/seedless-onboarding-controller@10.0.3-preview-c4108f3eb
@metamask-previews/selected-network-controller@26.1.5-preview-c4108f3eb
@metamask-previews/shield-controller@5.1.2-preview-c4108f3eb
@metamask-previews/signature-controller@39.2.7-preview-c4108f3eb
@metamask-previews/smart-transactions-controller@24.2.4-preview-c4108f3eb
@metamask-previews/snap-account-service@1.0.0-preview-c4108f3eb
@metamask-previews/social-controllers@2.3.1-preview-c4108f3eb
@metamask-previews/solana-test-validator-up@1.0.0-preview-c4108f3eb
@metamask-previews/stellar-quickstart-up@0.0.0-preview-c4108f3eb
@metamask-previews/storage-service@1.0.2-preview-c4108f3eb
@metamask-previews/subscription-controller@6.2.0-preview-c4108f3eb
@metamask-previews/transaction-controller@68.2.2-preview-c4108f3eb
@metamask-previews/transaction-pay-controller@23.17.4-preview-c4108f3eb
@metamask-previews/user-operation-controller@41.2.6-preview-c4108f3eb
@metamask-previews/wallet@7.0.0-preview-c4108f3eb
@metamask-previews/wallet-cli@0.0.0-preview-c4108f3eb

* @param infuraProjectId - The wallet's Infura project id.
* @returns True if the URL is a MetaMask Infura endpoint.
*/
export function getIsInfuraEndpoint(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just occurred to me, maybe this is something we can move to NetworkController. Or maybe we don't even need to check for this at all! If NetworkController can automatically correct misconfigured Infura RPC endpoints (and even consolidate duplicates) then we can go back to relying on the type property.

That's out of scope for this ticket but I'll add a new one to capture this. Then later we can come back and simplify this.

@mcmire mcmire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion below and then this looks good to me.

@cryptodev-2s
cryptodev-2s requested a review from mcmire July 7, 2026 21:24
@cryptodev-2s
cryptodev-2s enabled auto-merge July 7, 2026 21:24
cryptodev-2s and others added 3 commits July 8, 2026 13:48
The degraded and unavailable thresholds become constructor options with
the previous values as exported defaults, following the interval option
pattern used across controllers. The unavailable timeout is measured
from the same failure start and the constructor throws when it does not
exceed the degraded one, since the escalation timer runs for their
difference.

@mcmire mcmire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cryptodev-2s
cryptodev-2s added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 4ea4c16 Jul 8, 2026
420 of 421 checks passed
@cryptodev-2s
cryptodev-2s deleted the wpc-1014-network-connection-banner-controller branch July 8, 2026 21:25
cryptodev-2s added a commit that referenced this pull request Jul 8, 2026
…to 0.0.0

New packages start at 0.0.0 per the create-package template. #9041 shipped it at 0.1.0 by mistake.
cryptodev-2s added a commit that referenced this pull request Jul 8, 2026
…ontroller (#9436)

## Explanation

The package was merged in #9041 with an initial version of `0.1.0`. New
packages should start at `0.0.0` (that's what the `create-package`
template sets). This bumps it back down so the first release goes out
correctly.

## References

Follow up to #9041

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
- [x] I've prepared draft pull requests for cross repository changes as
appropriate

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Only `package.json` version metadata changes; no runtime or API
behavior is affected.
> 
> **Overview**
> Aligns `@metamask/network-connection-banner-controller` with the
monorepo convention for new packages by changing **`version`** in
`package.json` from **`0.1.0`** to **`0.0.0`**, matching the
`create-package` template and other unreleased packages.
> 
> This is a metadata-only fix so the first automated release can version
the package correctly after it was introduced with the wrong starting
version in #9041.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
08e6c20. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
pull Bot pushed a commit to dmrazzy/core that referenced this pull request Jul 8, 2026
…ontroller (MetaMask#9436)

## Explanation

The package was merged in MetaMask#9041 with an initial version of `0.1.0`. New
packages should start at `0.0.0` (that's what the `create-package`
template sets). This bumps it back down so the first release goes out
correctly.

## References

Follow up to MetaMask#9041

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
- [x] I've prepared draft pull requests for cross repository changes as
appropriate

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Only `package.json` version metadata changes; no runtime or API
behavior is affected.
> 
> **Overview**
> Aligns `@metamask/network-connection-banner-controller` with the
monorepo convention for new packages by changing **`version`** in
`package.json` from **`0.1.0`** to **`0.0.0`**, matching the
`create-package` template and other unreleased packages.
> 
> This is a metadata-only fix so the first automated release can version
the package correctly after it was introduced with the wrong starting
version in MetaMask#9041.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
08e6c20. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
pull Bot pushed a commit to dmrazzy/core that referenced this pull request Aug 17, 2026
…ler:stateChange (MetaMask#9893)

## Explanation

`NetworkConnectionBannerController` subscribes to
`ClientController:stateChanged` using an event type it defines locally.
`@metamask/client-controller` only declares and exports
`ClientController:stateChange`.

It works at runtime because `BaseController` publishes both names. This
is a contract cleanup, not a behavior fix.

Now the controller uses the exported `ClientControllerStateChangeEvent`,
dropping the duplicated local type and matching the three other upstream
subscriptions in the file.

Breaking: clients must delegate `ClientController:stateChange` instead
of `ClientController:stateChanged`, otherwise the controller stops
receiving UI open state and the banner never shows. Both extension and
mobile need the one line swap.

## References

- Introduced in MetaMask#9041

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by updating changelogs
for packages I've changed
- [x] I've introduced breaking changes in this PR and have prepared
draft pull requests for clients and consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a
summary for commit ec8b9d7. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
pull Bot pushed a commit to Reality2byte/metamask-mobile that referenced this pull request Aug 17, 2026
…ler (WPC-1014) (MetaMask#31225)

## **Description**

Replaces the in-app duplicate of the RPC connection banner rule + 5s/30s
timer escalation with the new
`@metamask/network-connection-banner-controller`, registered in mobile's
Engine.

**Wiring**

- `package.json` declares the controller as
`@metamask/network-connection-banner-controller` with a Yarn
`resolutions` alias to the preview tarball
(`@metamask-previews/network-connection-banner-controller@0.1.0-preview-7507a11`).
When the package ships under its real name, only the resolution line
gets removed — no code changes.
- New init + restricted-messenger files under `app/core/Engine/`;
registered in `Engine.ts`, `messengers/index.ts`, and `types.ts`.
- The preview package transitively resolves newer peer controllers than
mobile installs (`network-controller@^32` vs `@31`,
`connectivity-controller@^0.2` vs `@0.1`). Runtime shapes match (same
event names + state fields); the type-only mismatch at the messenger
boundary is bridged with one `as unknown as` cast in the messenger
factory — removable once mobile bumps versions.

**Cleanup**

- Deletes `app/reducers/networkConnectionBanner/` and
`app/actions/networkConnectionBanner/`.
- Selector now reads from
`engine.backgroundState.NetworkConnectionBannerController` and adapts to
the existing UI's `{ visible: boolean }` shape, so the banner component
is untouched.
- `useNetworkConnectionBanner` hook drops the inline
`checkNetworkStatus`, the two `setTimeout`s, the
`rpcEndpointChainAvailable` subscription, and all
`showNetworkConnectionBanner`/`hideNetworkConnectionBanner` dispatches.
`switchToInfura` now calls
`NetworkConnectionBannerController:switchToDefaultInfuraRpc`. Analytics
+ navigation unchanged.

Core PR: MetaMask/core#9041

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes:
[WPC-1014](https://consensyssoftware.atlassian.net/browse/WPC-1014)

## **Manual testing steps**

```gherkin
Feature: Banner driven by NetworkConnectionBannerController

  Scenario: single Infura blip during a wide outage
    Given all *.infura.io endpoints are unreachable
    When 30s elapse
    Then no banner appears (single registrable domain, suppressed)

  Scenario: custom RPC alone fails
    Given a custom RPC is configured and unreachable
    When 5s elapse
    Then the degraded banner appears for that custom network
    And tapping "Switch to MetaMask default RPC" switches to the chain's Infura endpoint and shows the success toast

  Scenario: two providers fail at once
    Given both an Infura network and an Alchemy network are unreachable
    When 5s elapse
    Then the degraded banner appears, escalating to unavailable at 30s

  Scenario: device offline
    Given the device is offline
    When any RPC times out
    Then no banner appears (existing offline short-circuit honored)
```

## **Screenshots/Recordings**

### **Before**

<!-- n/a — UX unchanged -->

### **After**

<!-- n/a — UX unchanged -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

#### Performance checks (if applicable)

- [ ] I've tested on Android
- [ ] I've tested with a power user scenario
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics

## **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.


[WPC-1014]:
https://consensyssoftware.atlassian.net/browse/WPC-1014?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches wallet home networking UX and RPC switching via a new
controller; behavior should match core#9041 but regressions in show/hide
rules or Infura switch are possible until manual QA.
> 
> **Overview**
> **Moves RPC connection banner logic out of Redux/UI into
`@metamask/network-connection-banner-controller`**, wired through Engine
init, a restricted messenger, and
`NetworkConnectionBannerController:stateChanged` syncing into
`engine.backgroundState`.
> 
> The **local Redux slice and show/hide actions are removed**; selectors
now expose `status` and `FailedNetwork` from controller state.
**`useNetworkConnectionBanner` no longer** polls `NetworkController`,
runs 5s/30s timers, or dispatches banner actions—**`switchToInfura`
calls**
`NetworkConnectionBannerController:switchToDefaultInfuraRpcEndpoint` via
a **route messenger** on Wallet (`WalletWithMessenger` in
`MainNavigator`). Banner UI reads `status` / `network` (e.g.
`switchableInfuraNetworkClientId` instead of `infuraNetworkClientId`).
**Engine** seeds and updates **`ClientController:setUiOpen`** on app
foreground so the controller only evaluates while the UI is open.
**`url-utils` / `ip-regex` / `psl` helpers used only for the old in-hook
suppression logic are dropped** with their tests.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2233f7c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
pull Bot pushed a commit to Eric-Johnson-1/metamask-extension that referenced this pull request Aug 17, 2026
…ler (WPC-1014) (MetaMask#43361)

## **Description**

Replaces the in-app duplicate of the RPC connection banner rule + 5s/30s
timer escalation with the new
`@metamask/network-connection-banner-controller`, registered in
`metamask-controller` alongside ConnectivityController.

Core PR: MetaMask/core#9041

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes:
[WPC-1014](https://consensyssoftware.atlassian.net/browse/WPC-1014)

## **Manual testing steps**

1. Build the extension; confirm
\`Engine.context.NetworkConnectionBannerController\` is reachable from
the background.
2. Open DevTools → Network panel. Block all \`*.infura.io\` hosts; wait
30s. **No banner** (single registrable domain, suppressed).
3. Block \`*.infura.io\` AND a non-Infura host. **Degraded** banner at
5s, **unavailable** at 30s.
4. Configure a custom RPC for any chain and block only that host.
**Degraded** banner appears; the \"Switch to MetaMask default RPC\"
button switches the chain back to its Infura endpoint and shows the
success toast.
5. Disable wifi. **No banner** — the existing offline short-circuit is
honored by the controller.

## **Screenshots/Recordings**

### **Before**

<!-- n/a — UX unchanged -->

### **After**

<!-- n/a — UX unchanged -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

[WPC-1014]:
https://consensyssoftware.atlassian.net/browse/WPC-1014?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes when and how RPC failure banners appear (logic now lives in an
external controller) and alters network/RPC switching paths users see
during outages; UX is intended to stay the same but regression risk is
in timing and suppression rules.
> 
> **Overview**
> **Moves the “Still connecting” / “Unable to connect” RPC banner out of
`AppStateController` and the UI** into
`@metamask/network-connection-banner-controller`, which owns the
show/hide rules, 5s/30s escalation, and subscriptions to network,
enablement, connectivity, client, and keyring state.
> 
> **Background:** Registers the controller in modular init
(`NetworkConnectionBannerControllerInit`, restricted messenger to
`NetworkController`, `NetworkEnablementController`,
`ConnectivityController`, etc.), adds it to `metamask-controller`, and
drops `networkConnectionBanner` / `updateNetworkConnectionBanner` from
`AppStateController`. Redux/background types now expose
`networkConnectionBannerStatus` and `networkConnectionBannerNetwork`
from the new controller.
> 
> **UI:** `useNetworkConnectionBanner` reads controller selectors
instead of running timers and dispatching banner updates; switching to
the default Infura RPC goes through
`NetworkConnectionBannerController:switchToDefaultInfuraRpcEndpoint` via
a Home route messenger. The banner component uses the controller’s
`FailedNetwork` shape (`switchableInfuraNetworkClientId` vs
`infuraEndpointIndex`). Removed the multichain selector
`selectFirstFailedNetworkForNetworkConnectionBanner`, `getDomain`/`psl`,
and `updateNetworkConnectionBanner` actions.
> 
> **Deps/policy:** Adds
`@metamask/network-connection-banner-controller`, bumps
`@metamask/connectivity-controller`, and updates LavaMoat policies
accordingly.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d3d88dc. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants