fix: should not be able to switch to any non permitted network WIP#27462
Draft
vinnyhoward wants to merge 3 commits intomainfrom
Draft
fix: should not be able to switch to any non permitted network WIP#27462vinnyhoward wants to merge 3 commits intomainfrom
vinnyhoward wants to merge 3 commits intomainfrom
Conversation
…mcu-311-manual-dapp-network-selection-switch-non-permitted-network
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. |
…witch-non-permitted-network
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - draft PR All E2E tests pre-selected. |
Contributor
|
✅ E2E Fixture Validation — Schema is up to date |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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