-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Remove toggle to turn on/off Per Dapp Selected Network Feature #28577
base: develop
Are you sure you want to change the base?
chore: Remove toggle to turn on/off Per Dapp Selected Network Feature #28577
Conversation
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. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@metamask/[email protected], npm/@metamask/[email protected] |
b23245a
to
8d37a93
Compare
…ed Network Feature (#4941) ## Explanation The "Select networks for each site" preference toggle on the experimental settings page has been live for many releases now since the toggle has been turned on by default. We meant to remove it a while ago. <img width="770" alt="Screenshot 2024-11-19 at 10 58 04 AM" src="https://github.com/user-attachments/assets/aeca2483-c019-4f9f-b44e-520d10db9eee"> This PR removes the togglability of per dapp selected network from the `SelectedNetworkController` and `QueuedRequestMiddleware` The extension to integrate this change will also have to implement a migration to remove this state. Another reason we should remove this now is that having this setting turned off is [causing a bug](MetaMask/metamask-extension#28441) to result with `wallet_switchEthereumChain` and the interaction between the new chain permissions feature and the absence of queuing. ## References Extension PR w/ preview builds of this PR (plus full removal of the toggle): MetaMask/metamask-extension#28577 When integrated in the extension will resolve this issue: MetaMask/metamask-extension#28441 ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/queued-request-controller` - **REMOVED**: `createQueuedRequestMiddleware` no longer expects a `useRequestQueue` property in its param options. ### `@metamask/selected-network-controller` - **REMOVED**: SelectedNetworkController constructure no longer expects either `useRequestQueuePreference` or `onPreferencesStateChange` params ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
app/scripts/migrations/132.ts
Outdated
isObject(state.PreferencesController) && | ||
hasProperty(state.PreferencesController, 'preferences') && | ||
isObject(state.PreferencesController.preferences) && | ||
hasProperty(state.PreferencesController.preferences, 'useRequestQueue') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably can delete without checking if it exists. doesn't really matter either way though
beautiful! just needs the core release cut and usage here |
f94712a
to
dc9ae6e
Compare
Description
The "Select networks for each site" preference toggle on the experimental settings page has been live for many releases now since the toggle has been turned on by default. We meant to remove it a while ago.
This PR removes this toggle and integrates new versions of the QueuedRequestController and SelectedNetworkController which remove the backend logic it operated.
Beyond the fact that this removal is overdue, another reason we should remove this now is that having this setting when turned off is causing a bug with
wallet_switchEthereumChain
and the interaction with the new chain permissions feature.References
core side changes: MetaMask/core#4941
#28441
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist