Skip to content

@metamask/controllers@15.0.0 - #11975

Merged
rekmarks merged 2 commits into
developfrom
@metamask/controllers@15.0.0
Aug 31, 2021
Merged

rekmarks merged 2 commits into
developfrom
@metamask/controllers@15.0.0

Conversation

@rekmarks

@rekmarks rekmarks commented Aug 31, 2021 •

Copy link
Copy Markdown
Contributor

Adds the latest version of @metamask/controllers, and updates our usage of the ApprovalController, which has been migrated to BaseControllerV2. Of the new controllers release, only the ApprovalController migration should be breaking.

This is the first time we use events on the ControllerMessenger to update the badge, so I turned the messenger into a property on the main MetaMaskController in order to subscribe to events on it in background.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).

Adds the latest version of `@metamask/controllers`, and updates our
usage of the `ApprovalController`, which has been migrated to
`BaseControllerV2`.
@rekmarks
rekmarks requested a review from a team as a code owner August 31, 2021 04:13
@rekmarks
rekmarks requested a review from darkwing August 31, 2021 04:13
const noop = () => undefined;

before(async function () {
globalThis.AbortController = window.AbortController;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an aside, that I had to do this has me wondering when we'll fully migrate to jest.

@metamaskbot

Copy link
Copy Markdown
Collaborator
Builds ready [581eb44]
Page Load Metrics (691 ± 19 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint54856584
domContentLoaded6277806904019
load6277826914019
domInteractive6267806893919

@rekmarks
rekmarks requested review from Gudahtt and shanejonas and removed request for darkwing August 31, 2021 07:40
Comment thread app/scripts/background.js
controller.controllerMessenger.subscribe(
METAMASK_CONTROLLER_EVENTS.APPROVAL_STATE_CHANGE,
updateBadge,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rekmarks rekmarks Aug 31, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@adonesky1 adonesky1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Gudahtt Gudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Most of the breaking changes in this release don't have any impact it seems. Just the ApprovalController really.

@rekmarks
rekmarks merged commit 8a8ce3a into develop Aug 31, 2021
@rekmarks
rekmarks deleted the @metamask/controllers@15.0.0 branch August 31, 2021 19:27
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants