fix: should not be able to switch to any non permitted network WIP#27462
fix: should not be able to switch to any non permitted network WIP#27462vinnyhoward wants to merge 2 commits intomainfrom
Conversation
…mcu-311-manual-dapp-network-selection-switch-non-permitted-network
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These directly impact the network management and chain permission system. SmokeNetworkAbstractions is required because it covers:
Because the changes involve multichain permissions and likely affect how dApps are granted/revoked access across chains, we must also include:
Per tag requirements: when changes affect dApp chain permissions or multi-chain selection, also select SmokeNetworkExpansion and SmokeMultiChainAPI. These integrations validate session scope consistency and provider behavior across chains. No evidence of impact to confirmations, trade, wallet platform, accounts, identity, or snaps flows. Overall risk is medium: changes touch core user-facing network selection and permission flows but do not modify Engine controllers or low-level transaction logic. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|



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:
NetworkSelectoralready has filtering logic for theMULTI_CHAIN_PERMISSIONS_SUMMARYsource; it readspermittedCaipChainIdsfromPermissionControllerand hides networks that aren't permitted. However, this only reflects the last confirmed/committed permission state.Remaining problem (stale state):
MultichainAccountPermissionsholds local in-progress stateselectedChainIdsthat is updated when the user submits changes from the "Edit Networks" screen, butPermissionControlleris 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 fromPermissionController, 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 committedPermissionControllerstate.Disable the badge tap: Hide or disable the network badge tap when there are pending unsaved changes (i.e., when local
selectedChainIdsdiffers from committed permissions).Changelog
CHANGELOG entry: WIP
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-311
Manual testing steps
Screenshots/Recordings
WIP
Before
WIP
After
WIP
Pre-merge author checklist
Pre-merge reviewer checklist