-
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
fix: Use latest DecryptMessageManager
EncryptMessageManager
to extend controllers
#29237
base: main
Are you sure you want to change the base?
Conversation
BaseController
migration for Decrypt/Encrypt
message managerDecryptMessageManager
EncryptMessageManager
to extend controllers
4174afe
to
fba4880
Compare
this._decryptMessageManager.hub.on('updateBadge', () => { | ||
this.hub.emit('updateBadge'); |
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.
XMessageManager
s will be emitting the X:updateBadge
via messaging system hence these are not needed anymore, we directly listen manager event on background.js
…eControllerV2` (#5103) ## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> This PR aims to remove `BaseControllerV1` usage from `AbstractMessageManager`. As expected this change affected both `DecryptMessageManager` (`DMM`) and `EncryptionPublicKeyManager`(`EPKM`). Since extension already have wrapper classes for both `DMM` & `EPKM` in the extension code, we want to keep changes minimal and make these both classes in the core work like controller but let wrappers sync the state in their classes as we currently do. You can find the extension PR in the references below. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> * Fixes : MetaMask/MetaMask-planning#3747 * Related extension PR: MetaMask/metamask-extension#29237 ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/message-manager` - **BREAKING:** Base class of `DecryptMessageManager` and `EncryptionPublicKeyManager`(`AbstractMessageManager`) now expects new options to initialise - **BREAKING:** Removed internal event emitter (`hub` property) from `AbstractMessageManager` - **BREAKING:** `unapprovedMessage` and `updateBadge` removed from internal events. These events are now emitted from messaging system - Controllers should now listen to `DerivedManagerName:X` event instead of using internal event emitter. ## Checklist - [X] I've updated the test suite for new or updated code as appropriate - [X] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [X] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [X] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Builds ready [c9c61f4]
Page Load Metrics (1755 ± 105 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
This PR aims to adapt latest changes in the
@metamask/message-manager
DecryptMessageManager
andEncryptionPublicKeyManager
classes. The latest change in core mainly tries to adaptBaseControllerV2
. Hence in the extension, minimum changes made in the wrapper classes to keep functionality as is.Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3747
Related core PR: MetaMask/core#5103
Manual testing steps
Encrypt / Decrypt
sectionScreenshots/Recordings
Encrypt.Decrypt.mov
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist