Conversation
3 tasks
3b3147f to
455e5c7
Compare
QueuedRequestControllerqueued-request-controller] Type definitions and fixes
mcmire
reviewed
Nov 13, 2023
Contributor
mcmire
left a comment
There was a problem hiding this comment.
As I've been looking through all of these controller messenger-related PRs I've been slowly getting confused. I reached out on Slack for some clarifying questions so I think the answers to those questions should help me review these changes more easily.
packages/queued-request-controller/src/QueuedRequestController.ts
Outdated
Show resolved
Hide resolved
packages/queued-request-controller/src/QueuedRequestController.ts
Outdated
Show resolved
Hide resolved
queued-request-controller] Type definitions and fixesqueued-request-controller] Convert messengers and middleware to use RestrictedControllerMessenger
e19cf32 to
cc4e01c
Compare
c16209d to
4efc27d
Compare
queued-request-controller] Convert messengers and middleware to use RestrictedControllerMessengerqueued-request-controller] Apply AllowedActions, MiddlewareMessenger patterns, fix any
49e7def to
637f2f6
Compare
…ternal actions/events
…e by `QueuedRequestMiddlewareMessenger`
01befcb to
12141b0
Compare
12141b0 to
48da295
Compare
…request-controller`
…owed actions/events for the middleware messenger vs. the restricted `SelectedNetworkControllerMessenger`
…twork-controller`
…into individual test files
queued-request-controller] Apply AllowedActions, MiddlewareMessenger patterns, fix anyAllowedActions, MiddlewareMessenger patterns, fix any
mcmire
reviewed
Nov 29, 2023
Contributor
mcmire
left a comment
There was a problem hiding this comment.
This is super. Thanks for doing this. Just had a few comments and then I think we're good.
packages/queued-request-controller/src/QueuedRequestMiddleware.ts
Outdated
Show resolved
Hide resolved
packages/queued-request-controller/src/QueuedRequestMiddleware.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
AllowedActions, MiddlewareMessenger patterns, fix anyMiddlewareMessenger pattern, fix any
…ow internal actions/events by default
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Apply controller-messenger pattern
QueuedRequestMiddlewareMessenger,SelectedNetworkMiddlewareMessengertypes to represent external controller messengers in the middleware chain.QueuedRequest{Controller,Middleware}MessengerandSelectedNetwork{Controller,Middleware}Messenger.Type fixes
QueuedRequestMiddlewareJsonRpcRequest,SelectedNetworkMiddlewareJsonRpcRequesttypes.anyusage increateSelectedNetworkMiddlewareTests
any,as anyusage inQueuedRequestController,QueuedRequestMiddlewaretests.MiddlewareMessengerpattern, fixany#1970 (comment)References
base-controller] Enforce thatRestrictedControllerMessengeris not initialized with internal actions/events in allow lists #2051AllowedActions,MiddlewareMessengerpatterns, fixany#2038Changelog
@metamask/queued-request-controllerQueuedRequestMiddlewareJsonRpcRequesttypeeQueuedRequestControllerMessengercan no longer be defined with any allowed actions or events.@metamask/approval-controllerfrom devDeps to deps.@metamask/selected-network-controllerSelectedNetworkMiddlewareJsonRpcRequesttypeSelectedNetworkControllerActiontoSelectedNetworkControllerActionsandSelectedNetworkControllerEventtoSelectedNetworkControllerEventsfor consistency with corresponding type exports from other controllers.createSelectedNetworkMiddlewarereturn type is constrained to satisfyJsonRpcMiddleware<JsonRpcParams, Json>, and thereqparameter needs to satisfySelectedNetworkMiddlewareJsonRpcRequest.Checklist