-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
QueuedRequestController
batching (#22865)
## **Description** The `QueuedRequestController` will now batch requests by origin. Requests from the same UI now get shown together, just as they were before this queuing feature was added. The only remaining difference is that we no longer show requests from different origins in the same batch, which we view as a security/usability improvement. ## **Related issues** Fixes: ## **Manual testing steps** **important** make sure any dapp used for testing has a permission (eth_accounts for example), as well as the per-domain network feature flag turned on, then refresh the dapp before begining testing. make sure to also test that everything works unchanged with the feature flag off 1. Turn on per-domain network feature flag 2. go to test dapp and connect 3. refresh the test dapp 4. go to any other website (msn.com for example) 5. in the devtools, run this: ``` await window.ethereum.request({ "method": "wallet_requestPermissions", "params": [ { "eth_accounts": {} } ] }); ``` 6. go back to the testdapp tab, make 2 or 3 send transaction calls 7. ensure that the UI displays the number of transactions being processed, and allows you to go back and forward through the transactions. 8. before confirming or rejecting any of those transactions, switch to the tab with msn.ca and run this 2-3 times: ``` await window.ethereum.request({ "method": "eth_sendTransaction", "params": [ { "to": "0x77ff877eE79c3f8C5aD244c037e5580EdCC6eF2c", "from": "your address", "value": "0x1" } ] }); ``` 9. ensure that the you are still only able to scrub through the 3 transactions. Reject each of them. 10. You should now see the next set of 3 (from the domain msn.com). ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Zachary Belford <belfordz66@gmail.com> Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
- Loading branch information
1 parent
23dbcb5
commit 1bb5dcd
Showing
11 changed files
with
144 additions
and
163 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.