Repository navigation
@metamask/controllers@15.0.0 - #11975
Merged
Merged
Conversation
Adds the latest version of `@metamask/controllers`, and updates our usage of the `ApprovalController`, which has been migrated to `BaseControllerV2`.
rekmarks
commented
Aug 31, 2021
| const noop = () => undefined; | ||
|
|
||
| before(async function () { | ||
| globalThis.AbortController = window.AbortController; |
Contributor
Author
There was a problem hiding this comment.
As an aside, that I had to do this has me wondering when we'll fully migrate to jest.
Collaborator
Builds ready [581eb44]
Page Load Metrics (691 ± 19 ms)
|
rekmarks
requested review from
Gudahtt and
shanejonas
and removed request for
darkwing
August 31, 2021 07:40
shanejonas
reviewed
Aug 31, 2021
| controller.controllerMessenger.subscribe( | ||
| METAMASK_CONTROLLER_EVENTS.APPROVAL_STATE_CHANGE, | ||
| updateBadge, | ||
| ); |
Contributor
There was a problem hiding this comment.
somewhat related nit: we never clean up any of these listeners in this file.
this main controller only gets used once in the lifecycle so we dont need to, but just wanted to point it out
Contributor
Author
There was a problem hiding this comment.
I am pretty confident that we have would be surprised if we don't have event-related leaks, so it's great to keep an eye out for it!
Gudahtt
approved these changes
Aug 31, 2021
Gudahtt
left a comment
Member
There was a problem hiding this comment.
LGTM! Most of the breaking changes in this release don't have any impact it seems. Just the ApprovalController really.
shanejonas
approved these changes
Aug 31, 2021
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Adds the latest version of
@metamask/controllers, and updates our usage of theApprovalController, which has been migrated toBaseControllerV2. Of the newcontrollersrelease, only theApprovalControllermigration should be breaking.This is the first time we use events on the
ControllerMessengerto update the badge, so I turned the messenger into a property on the mainMetaMaskControllerin order to subscribe to events on it inbackground.js. I confirmed that the badge does indeed update during local QA.As it turns out, MetaMask/controllers#571 was breaking for a single unit test case, which is now handled during setup and teardown for the related test suite (
metamask-controller.test.js).