Skip to content

fix: should not be able to switch to any non permitted network WIP#27462

Draft
vinnyhoward wants to merge 3 commits intomainfrom
fix-tmcu-311-manual-dapp-network-selection-switch-non-permitted-network
Draft

fix: should not be able to switch to any non permitted network WIP#27462
vinnyhoward wants to merge 3 commits intomainfrom
fix-tmcu-311-manual-dapp-network-selection-switch-non-permitted-network

Conversation

@vinnyhoward
Copy link
Copy Markdown
Contributor

Description

Fixes a bug where the network picker opened from the dapp permissions summary allows the user to switch to a network that is not permitted for that dapp.

What's broken: When a user opens the permissions summary for a connected dapp (browser → account icon → Permissions), there is a tappable network badge on the dapp favicon. Tapping it opens NetworkSelector. The selector is supposed to filter the network list to only show the dapp's permitted networks, but in practice the user can still select a non-permitted network and switch to it.

Partial fix in place in this PR: NetworkSelector already has filtering logic for the MULTI_CHAIN_PERMISSIONS_SUMMARY source; it reads permittedCaipChainIds from PermissionController and hides networks that aren't permitted. However, this only reflects the last confirmed/committed permission state.

Remaining problem (stale state): MultichainAccountPermissions holds local in-progress state selectedChainIds that is updated when the user submits changes from the "Edit Networks" screen, but PermissionController is only updated when the user taps "Confirm"/"Update". So after a user unchecks a network in "Edit Networks" and returns to the summary screen; but before they confirm the network picker still shows the old stale list of permitted networks from PermissionController, including the one they just deselected. The user can then switch to it.

Open UX question (needs team input before proceeding): There are two viable approaches:

Pass in-progress state: Thread selectedChainIds (local state from MultichainAccountPermissions) through the navigation params to NetworkSelector, so the picker filters by the current in-progress selection rather than the committed PermissionController state.
Disable the badge tap: Hide or disable the network badge tap when there are pending unsaved changes (i.e., when local selectedChainIds differs from committed permissions).

Changelog

CHANGELOG entry: WIP

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-311

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

WIP

Before

WIP

After

WIP

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.

@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.

@metamaskbot metamaskbot added the team-mobile-ux Mobile UX team label Mar 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - draft PR

All E2E tests pre-selected.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants