Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QueuedRequestController: Fix list of methods that should have request…
…s enqueued and/or switch the globally selected network (#4066) ## Explanation Previously we were not properly enqueuing requests that could trigger a confirmation notification as well as not switching networks for methods that either require it or would exhibit unexpected UI/UX without doing so beforehand. This PR improves the specificity of which methods should be handled differently in the queued request flow which covers many methods not previously handled correctly. ## References See: MetaMask/metamask-extension#22865 (comment) ## Changelog ### `@metamask/queued-request-controller` #### Added - **BREAKING**: The `QueuedRequestMiddleware` constructor now requires the `methodsWithConfirmation` param which should be a list of methods that can trigger confirmations ([#4066](#4066)) - **BREAKING**: The `QueuedRequestController` constructor now requires the `methodsRequiringNetworkSwitch` param which should be a list of methods that need the globally selected network to switched to the dapp selected network before being processed ([#4066](#4066)) #### Changed - **BREAKING**: `QueuedRequestController.enqueueRequest()` now ensures the globally selected network matches the dapp selected network before processing methods listed in the `methodsRequiringNetworkSwitch` constructor param. This replaces the previous behavior of switching for all methods except `eth_requestAccounts`. ([#4066](#4066)) ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
- Loading branch information