-
Notifications
You must be signed in to change notification settings - Fork 5k
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
feat: Add QueuedRequestController
batching
#22865
Conversation
3729bc0
to
bb0c1f8
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
7609fc7
to
8d996b5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
b48f306
to
d0d4e69
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
0edb792
to
589b95d
Compare
@metamaskbot update-policies |
Policies updated |
77877c4
to
8bae679
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
b865770
to
48bf48b
Compare
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@metamask/[email protected] |
@@ -286,7 +286,7 @@ | |||
"@metamask/post-message-stream": "^8.0.0", | |||
"@metamask/ppom-validator": "^0.27.0", | |||
"@metamask/providers": "^14.0.2", | |||
"@metamask/queued-request-controller": "^0.3.0", | |||
"@metamask/queued-request-controller": "^0.6.0", |
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.
This is resulting in a bunch of peer dependency warnings
TODO: Validate that they're safe to ignore, or bump the other packages as well in the same PR
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.
Seems like theres only the one warning about queued request controller using a different version of selected network controller:
@metamask/selected-network-controller is listed by your project with version 9.0.0, which doesn't satisfy what @metamask/queued-request-controller (p81a9c) requests (^10.0.0).
the main change in 10.x.x is the update to base controller. The API afaik is the same, the typings have changed a bit here and there, but we arent getting any type errors so I think we are good to go.
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.
The test description here talks about showing network confirmations, but we don't show confirmations on switch anymore.
Perhaps we should update this test to show that the network is switching, and leave about the "confirmations" part.
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.
The same goes for the other request queuing test suite as well
4be5554
to
daa17b5
Compare
update: Ive re-tested the 2nd issue and it doesn't seem to be a problem anymore. Not sure what was going on before, but it seems to work as expected now. (just make sure the dapp has permissions, otherwise everything is pretty messed up) |
0c58d7a
to
26a8dc5
Compare
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. |
Rebased to resolve conflicts |
@metamaskbot update-policies |
Policies updated |
Scenario works for me |
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.
0081e90
to
4e5072a
Compare
Rebased again! |
Builds ready [633db2b]
Page Load Metrics (474 ± 375 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [6a238e1]
Page Load Metrics (877 ± 516 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
I have re-reviewed the recent changes, LGTM! |
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
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist