fix: Use latest DecryptMessageManager EncryptMessageManager to extend controllers#29237
Merged
fix: Use latest DecryptMessageManager EncryptMessageManager to extend controllers#29237
DecryptMessageManager EncryptMessageManager to extend controllers#29237Conversation
Merged
4 tasks
BaseController migration for Decrypt/Encrypt message managerDecryptMessageManager EncryptMessageManager to extend controllers
4174afe to
fba4880
Compare
jpuri
previously approved these changes
Jan 7, 2025
OGPoyraz
commented
Jan 7, 2025
Comment on lines
-178
to
-179
| this._decryptMessageManager.hub.on('updateBadge', () => { | ||
| this.hub.emit('updateBadge'); |
Member
Author
There was a problem hiding this comment.
XMessageManagers will be emitting the X:updateBadge via messaging system hence these are not needed anymore, we directly listen manager event on background.js
matthewwalsh0
requested changes
Jan 8, 2025
matthewwalsh0
previously approved these changes
Jan 9, 2025
OGPoyraz
added a commit
to MetaMask/core
that referenced
this pull request
Jan 14, 2025
…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
Member
Author
|
@metamaskbot update-policies |
Collaborator
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Collaborator
Builds ready [c9c61f4]
Page Load Metrics (1755 ± 105 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
jpuri
previously approved these changes
Jan 17, 2025
Member
Author
|
@metamaskbot update-policies |
Collaborator
|
No policy changes |
Collaborator
Builds ready [aeeba44]
Page Load Metrics (2311 ± 130 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Member
Author
|
@metamaskbot update-policies |
Collaborator
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Collaborator
Builds ready [1a26e5a]
Page Load Metrics (1784 ± 59 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
matthewwalsh0
approved these changes
Jan 27, 2025
jpuri
approved these changes
Jan 27, 2025
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.
Description
This PR aims to adapt latest changes in the
@metamask/message-managerDecryptMessageManagerandEncryptionPublicKeyManagerclasses. 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 / DecryptsectionScreenshots/Recordings
Encrypt.Decrypt.mov
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist