Skip to content

fix: adding alert for network RPC issue#30351

Merged
jpuri merged 3 commits into
mainfrom
send_network_alert
May 20, 2026
Merged

fix: adding alert for network RPC issue#30351
jpuri merged 3 commits into
mainfrom
send_network_alert

Conversation

@jpuri

@jpuri jpuri commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

Add alert on send page if RPC url is not correct.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1399

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Screen.Recording.2026-05-19.at.10.34.44.AM.mov

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Medium Risk
Changes the send amount step to depend on NetworkController connectivity metadata, disabling progression and auto-showing a modal that can navigate to EDIT_NETWORK. Risk is moderate because it alters user flow gating and navigation behavior during sends, but is scoped and covered by new tests.

Overview
Adds an unreliable network guard to the send amount step: when NetworkController reports the selected chain’s RPC as non-Available, the amount screen now disables Continue and auto-opens a SendAlertModal prompting the user to Update network settings.

Introduces useUnreliableNetworkAlert (with tests) to derive the alert from the current chainId and network metadata and to navigate to Routes.EDIT_NETWORK with the active RPC URL; adds AmountAlerts (with tests) to manage modal open/close behavior per chain. Updates English strings for the new alert title/description and “Update” label.

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

@jpuri jpuri requested a review from a team as a code owner May 19, 2026 06:04
@jpuri jpuri added team-confirmations Push issues to confirmations team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels May 19, 2026
@github-actions

Copy link
Copy Markdown
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.

@jpuri jpuri enabled auto-merge May 19, 2026 06:05

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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 d2bb216. Configure here.

@jpuri

jpuri commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Fixture update started. Running workflow from branch send_network_alert. View workflow runs

@github-actions

Copy link
Copy Markdown
Contributor

E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@jpuri

jpuri commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

1 similar comment
@jpuri

jpuri commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Fixture update started. Running workflow from branch send_network_alert. View workflow runs

@github-actions

Copy link
Copy Markdown
Contributor

E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@jpuri

jpuri commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Fixture update started. Running workflow from branch send_network_alert. View workflow runs

@github-actions

Copy link
Copy Markdown
Contributor

E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@jpuri

jpuri commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-mobile-fixture

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Fixture update started. Running workflow from branch send_network_alert. View workflow runs

@github-actions

Copy link
Copy Markdown
Contributor

E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR introduces new functionality in the send/amount flow within the confirmations system:

  1. New AmountAlerts component (amount-alerts.tsx): Renders a SendAlertModal when the network is unreliable during the send flow. Auto-opens when a new chain is selected and the network is unreliable.

  2. New useUnreliableNetworkAlert hook (useUnreliableNetworkAlert.ts): Detects unreliable network status by reading NetworkController state (networksMetadata status). Returns an alert object and a navigation function to edit the network.

  3. Modified AmountKeyboard component (amount-keyboard.tsx): Integrates the new AmountAlerts component and disables the Continue button when unreliableNetworkAlert is truthy. This is a behavioral change to the send flow's amount entry screen.

  4. Localization (en.json): Adds 3 new strings for the unreliable network alert UI.

Why SmokeConfirmations: The changes directly affect the send flow's amount entry step, which is part of the confirmations system. The AmountKeyboard now disables the Continue button under certain network conditions, which could affect E2E send transaction tests. The send E2E tests (send-native-token.spec.ts, send-erc20-token.spec.ts) are tagged with SmokeConfirmations (though currently skipped/covered by component tests). The broader confirmations tests (transaction-pay, dapp-initiated-transfer) should be validated to ensure the network status check doesn't inadvertently block transactions in test environments.

No other tags needed: The changes are isolated to the send/amount flow within confirmations. No swap, stake, network management, or account management flows are affected. The network status check is read-only from NetworkController state and doesn't modify network configuration.

Performance Test Selection:
The changes are additive UI features (new modal alert and button disable logic) in the send/amount flow. They don't affect rendering performance of lists, app startup, login, or other performance-sensitive areas. The new hook reads from Redux state (already cached) and the modal is conditionally rendered only when network is unreliable. No performance impact expected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@OGPoyraz OGPoyraz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we apply this change in order to get rid of this visual bug on top of screen: #30433

Before:
Screenshot 2026-05-20 at 12 45 48

After:
Screenshot 2026-05-20 at 12 43 12

@OGPoyraz OGPoyraz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving as fix will be followup

@jpuri jpuri added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit 0ea9a63 May 20, 2026
194 checks passed
@jpuri jpuri deleted the send_network_alert branch May 20, 2026 12:32
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-L team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants