Skip to content

Conversation

vinnyhoward
Copy link
Contributor

@vinnyhoward vinnyhoward commented Sep 29, 2025

Description

Fixes balance loading issue when adding a new network from a dapp and immediately attempting to
transact. Previously, users would see no balance when trying to swap/transact on a newly added
non-permitted network, requiring them to navigate to the wallet home screen first to trigger balance
loading.

Changelog

CHANGELOG entry:Fixed issue where dapp swap transaction cannot complete on a non-permitted network

Related issues

Fixes: #19799

Manual testing steps

Feature: Dapp Swap Transaction

  Scenario: user adds a non-permitted network on a dApp like Uniswap
    Given user is connected to a dapp
    And user has a balance on the non-permitted network (Like Avax)
    When user initiates swap 
    Then user adds non-permitted network during the swaps flow
    And user gets a balance and can swap successfully

Screenshots/Recordings

~

Before

before.mp4

After

after.mp4

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

Ensures AssetPollingProvider always polls the transaction’s chainId (deduped, EVM-only), and adds comprehensive tests for edge cases.

  • Confirmations:
    • Update confirmation-asset-polling-provider.tsx to build pollChainIds from EVM bridge chains and always include the transaction chainId (as Hex), avoiding duplicates.
    • Memoize with dependency on transactionMeta?.chainId.
  • Tests:
    • Extend confirmation-asset-polling-provider.test.tsx:
      • Validate inclusion of tx chainId even if not in bridge chains and no duplication when it is.
      • Handle empty bridge chains and filter non-EVM chains.
      • Cover newly added custom networks from dapps.
      • Adjust typings to Hex and expectations for chainId handling.

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

@vinnyhoward vinnyhoward requested a review from a team as a code owner September 29, 2025 20:30
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.

@vinnyhoward vinnyhoward added the team-confirmations Push issues to confirmations team label Sep 29, 2025
@sleepytanya
Copy link
Contributor

Bitrise build:
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cb53edff-c79d-4e7d-945f-835c1643a9d7?tests_filter_status=failed

Fix works on iOS and Android physical devices. Alert is briefly shown when the first tx on a newly selected network is submitted, but tx submits succesfully.

iOS:

iOS-fix.mp4

Android:

android-fix.mov

@sleepytanya sleepytanya added the QA Passed QA testing has been completed and passed label Sep 29, 2025
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.50%. Comparing base (ba49b5f) to head (99f0926).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20551      +/-   ##
==========================================
+ Coverage   76.48%   76.50%   +0.01%     
==========================================
  Files        3386     3388       +2     
  Lines       83430    83486      +56     
  Branches    15445    15454       +9     
==========================================
+ Hits        63810    63869      +59     
+ Misses      15325    15321       -4     
- Partials     4295     4296       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@vinnyhoward vinnyhoward changed the title fix: dApp swaps failure on non-permitted network fix: cp-7.56.1 dApp swaps failure on non-permitted network Sep 30, 2025
@vinnyhoward vinnyhoward added this pull request to the merge queue Sep 30, 2025
Merged via the queue into main with commit 84ca8bd Sep 30, 2025
110 of 111 checks passed
@vinnyhoward vinnyhoward deleted the fix-19799-dapp-swaps-failure-on-non-permitted-network branch September 30, 2025 14:17
@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2025
@metamaskbot metamaskbot added release-7.57.0 Issue or pull request that will be included in release 7.57.0 release-7.56.1 Issue or pull request that will be included in release 7.56.1 and removed release-7.57.0 Issue or pull request that will be included in release 7.57.0 labels Sep 30, 2025
@metamaskbot
Copy link
Collaborator

Missing release label release-7.56.1 on PR. Adding release label release-7.56.1 on PR and removing other release labels(release-7.57.0), as PR was cherry-picked in branch 7.56.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed QA testing has been completed and passed release-7.56.1 Issue or pull request that will be included in release 7.56.1 size-M team-confirmations Push issues to confirmations team team-mobile-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: When transaction made on non-permitted network, only one token is shown in the wallet with the 0 balance, transaction can't be submitted
5 participants