Skip to content
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

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Nov 15, 2024

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.

Screenshot 2024-11-19 at 10 58 04 AM

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 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

  • 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

@adonesky1 adonesky1 force-pushed the ad/remove-request-queue-toggleability branch from c4089a8 to 3196bc4 Compare November 19, 2024 16:50
@adonesky1 adonesky1 force-pushed the ad/remove-request-queue-toggleability branch from 3196bc4 to fc955bd Compare November 19, 2024 16:53
@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "19.0.0-preview-fc955bd0",
  "@metamask-previews/address-book-controller": "6.0.1-preview-fc955bd0",
  "@metamask-previews/announcement-controller": "7.0.1-preview-fc955bd0",
  "@metamask-previews/approval-controller": "7.1.1-preview-fc955bd0",
  "@metamask-previews/assets-controllers": "44.0.0-preview-fc955bd0",
  "@metamask-previews/base-controller": "7.0.2-preview-fc955bd0",
  "@metamask-previews/build-utils": "3.0.1-preview-fc955bd0",
  "@metamask-previews/chain-controller": "0.1.3-preview-fc955bd0",
  "@metamask-previews/composable-controller": "9.0.1-preview-fc955bd0",
  "@metamask-previews/controller-utils": "11.4.3-preview-fc955bd0",
  "@metamask-previews/ens-controller": "15.0.0-preview-fc955bd0",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-fc955bd0",
  "@metamask-previews/gas-fee-controller": "22.0.1-preview-fc955bd0",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-fc955bd0",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-fc955bd0",
  "@metamask-previews/keyring-controller": "18.0.0-preview-fc955bd0",
  "@metamask-previews/logging-controller": "6.0.2-preview-fc955bd0",
  "@metamask-previews/message-manager": "11.0.1-preview-fc955bd0",
  "@metamask-previews/multichain": "0.0.0-preview-fc955bd0",
  "@metamask-previews/name-controller": "8.0.1-preview-fc955bd0",
  "@metamask-previews/network-controller": "22.0.2-preview-fc955bd0",
  "@metamask-previews/notification-controller": "7.0.0-preview-fc955bd0",
  "@metamask-previews/notification-services-controller": "0.13.0-preview-fc955bd0",
  "@metamask-previews/permission-controller": "11.0.3-preview-fc955bd0",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-fc955bd0",
  "@metamask-previews/phishing-controller": "12.3.0-preview-fc955bd0",
  "@metamask-previews/polling-controller": "12.0.1-preview-fc955bd0",
  "@metamask-previews/preferences-controller": "14.0.0-preview-fc955bd0",
  "@metamask-previews/profile-sync-controller": "1.0.0-preview-fc955bd0",
  "@metamask-previews/queued-request-controller": "7.0.1-preview-fc955bd0",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-fc955bd0",
  "@metamask-previews/selected-network-controller": "19.0.0-preview-fc955bd0",
  "@metamask-previews/signature-controller": "22.0.0-preview-fc955bd0",
  "@metamask-previews/transaction-controller": "39.0.0-preview-fc955bd0",
  "@metamask-previews/user-operation-controller": "18.0.0-preview-fc955bd0"
}

@adonesky1 adonesky1 changed the title remove queuedRequestPreference chore: Remove useRequestQueue toggle to turn on/off Per Dapp Selected Network Feature Nov 20, 2024
@adonesky1 adonesky1 marked this pull request as ready for review November 20, 2024 22:13
@adonesky1 adonesky1 requested review from a team as code owners November 20, 2024 22:13
Copy link
Contributor

@mcmire mcmire left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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

@adonesky1 adonesky1 merged commit 4814cf1 into main Nov 22, 2024
120 checks passed
@adonesky1 adonesky1 deleted the ad/remove-request-queue-toggleability branch November 22, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants