Closed
Conversation
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. |
Member
Author
|
Bisect Logs:
|
This was referenced Feb 19, 2024
adonesky1
added a commit
that referenced
this pull request
Mar 1, 2024
…ate (#23130) - Bumps to the the latest version of `@metamask/selected-network-controller` which fixes issue where the `SelectedNetworkController` adds any and all domains the user visits to its `domains` state whether or not the user has connected to these sites. - Adds a migration to clean up the undesired state caused by this bug. - Adds logic to listen for updates to permissions state and add newly connected/permissioned dapps to `domains` state in the `SelectedNetworkController`. I've created a ticket [here](https://app.zenhub.com/workspaces/wallet-api-platform-63bee08a4e3b9d001108416e/issues/gh/metamask/metamask-planning/2142) to move this logic into the `SelectedNetworkController` itself. - Adds logic to couple the `useRequestQueue` feature flag with the `perDomainNetwork` feature flag. I've created a ticket [here](https://app.zenhub.com/workspaces/wallet-api-platform-63bee08a4e3b9d001108416e/issues/gh/metamask/metamask-planning/2143) to remove the latter state since it is redundant and requires keeping these two booleans in sync. - Removes calls to `setNetworkClientIdForMetamask` since the [latest version of `@metamask/selected-network-controller`](https://github.com/MetaMask/core/blob/main/packages/selected-network-controller/CHANGELOG.md#800) removes this method (and the `metamask` domain from the `domains` state entirely). - Adds logic to use provider and blockTracker from the `SelectedNetworkController` when feature flag is on and connected origin is in `domains` state (which can only happen when the dapp is connected) in `setupProviderEngine` for RPC middleware stack. - Fixes a bug where if a dapp prompts an `addEthereumChain` request and the user then accepts the subsequent `switchEthereumChain` call that is chained on, the `networkClientID` set for that dapp in the `SelectedNetworkController` domains state will not be updated. Manual Testing Steps well first you need to [comment out some code](#22964) that is causing [a separate bug (found on develop)](#22937) but one that will make manually testing this a nightmare. 1. Go to `settings` > `experimental` > `Select networks for each site` and toggle this setting on 2. Put the globally selected network to ethereum mainnet 3. Connect to [uniswap](https://app.uniswap.org/swap) 4. Connect to [pancakeswap](https://pancakeswap.finance/) 5. Vist [Aave](https://app.aave.com/) but don't connect the wallet 6. Open devtools in the wallet UI and run the follow command in the console: ``` const { metamask } = await window.stateHooks.getCleanAppState(); console.log(metamask.domains) ``` 7. You should see the following log: ``` {https://app.uniswap.org: 'mainnet', https://pancakeswap.finance: 'mainnet'} ``` 8. Now call `switchEthereumChain` on one of the connected dapps (they each have UI elements that do this) 9. Now go back to the other dapp (where the chain hasn't been switched) and initiate a transaction 10. You should receive a `switchEthereumChain` confirmation back to Ethereum Mainnet before the transaction confirmation is show.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist