-
-
Notifications
You must be signed in to change notification settings - Fork 203
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 useRequestQueue
toggle to turn on/off Per Dapp Selected Network Feature
#4941
Conversation
c4089a8
to
3196bc4
Compare
3196bc4
to
fc955bd
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
useRequestQueue
toggle to turn on/off Per Dapp Selected Network Feature
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.
Looks good to me. I see auto-merge is on so I will wait a bit for others to respond. I will approve later if it seems okay.
// if the request queue feature is turned off, or this method is not a confirmation method | ||
// bypass the queue completely | ||
if (!useRequestQueue() || !shouldEnqueueRequest(req)) { | ||
// if this method is not a confirmation method bypass the queue completely |
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.
// if this method is not a confirmation method bypass the queue completely | |
// if this method is not a confirmation method then bypass the queue completely |
nit. not important
## Changelog ### `@metamask/queued-request-controller` ## 7.1.0 ### Removed - `createQueuedRequestMiddleware` no longer takes a `useRequestQueue` parameter. All requests are now queued if `shouldEnqueueRequest(req)` returns true. ([#4941](#4941)) ### `@metamask/selected-network-controller ## 19.1.0 ### Removed - The `SelectedNetworkController` constructor no longer expects a `useRequestPreference` boolean nor an `onPreferencesStateChange` listener. Removal of these parameters means that `domains` state will always be added for sites that are granted permissions. ([#4941](#4941)) --------- Co-authored-by: Mark Stacey <markjstacey@gmail.com>
## Changelog ### `@metamask/queued-request-controller` ## 7.1.0 ### Removed - `createQueuedRequestMiddleware` no longer takes a `useRequestQueue` parameter. All requests are now queued if `shouldEnqueueRequest(req)` returns true. ([#4941](#4941)) ### `@metamask/selected-network-controller ## 19.1.0 ### Removed - The `SelectedNetworkController` constructor no longer expects a `useRequestPreference` boolean nor an `onPreferencesStateChange` listener. Removal of these parameters means that `domains` state will always be added for sites that are granted permissions. ([#4941](#4941)) --------- Co-authored-by: Mark Stacey <markjstacey@gmail.com>
…p Selected Network Feature (#4941)" (#5065) This reverts commit 4814cf1. ## Explanation We are not yet ready to release per-dapp selected network functionality on the mobile client and with this change there is no clean way to [update the version of SelectedNetworkController](MetaMask/metamask-mobile#12434 (comment)) in the mobile client without having the Domains state starting to populate and possibly become corrupt since its not being consumed by/updated by the frontend in the expected way and may need to be migrated away when its time to actually start using the controller. Without this revert the @MetaMask/wallet-framework team is blocked from completing their goal to get both clients up to the latest versions of all controllers. ## 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` - **ADDED**: **BREAKING:** `createQueuedRequestMiddleware` now expects a `useRequestQueue` property in its param options ### `@metamask/selected-network-controller` - **ADDED**: **BREAKING:** `SelectedNetworkController` constructor now expects both a `useRequestQueuePreference` and a `onPreferencesStateChange` param ## 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
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.
This PR removes the togglability of per dapp selected network from the
SelectedNetworkController
andQueuedRequestMiddleware
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 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
@metamask/queued-request-controller
createQueuedRequestMiddleware
no longer expects auseRequestQueue
property in its param options.@metamask/selected-network-controller
useRequestQueuePreference
oronPreferencesStateChange
paramsChecklist