Skip to content

refactor: migrate NetworkEnablementController to @metamask/messenger - #6540

Merged
FrederikBolding merged 7 commits into
mainfrom
cryptodev-2s/messenger/network-enablement-controller
Oct 27, 2025
Merged

refactor: migrate NetworkEnablementController to @metamask/messenger#6540
FrederikBolding merged 7 commits into
mainfrom
cryptodev-2s/messenger/network-enablement-controller

Conversation

@cryptodev-2s

@cryptodev-2scryptodev-2s commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

Explanation

This PR migrates NetworkEnablementController to the new @metamask/messenger message bus, as opposed to the one exported from @metamask/base-controller.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Migrates NetworkEnablementController to the new @metamask/messenger API, updates metadata and tests, and adds related package/config references.

  • Controller:
    • Migrate from RestrictedMessenger (@metamask/base-controller) to Messenger (@metamask/messenger); update type NetworkEnablementControllerMessenger and wiring.
    • Switch imports to @metamask/base-controller/next and replace messagingSystem.call with messenger.call.
    • Keep existing logic; update subscribe handlers to new messenger usage.
    • Rename metadata key from anonymous to includeInDebugSnapshot.
  • Tests (src/NetworkEnablementController.test.ts):
    • Rework to use root/child Messenger instances with delegation; publish via rootMessenger.
    • Update spies to target messenger.call; remove old helper and adjust setups accordingly.
  • Docs/Config:
    • Add @metamask/messenger dependency and TS project references; update README dependency graph to include messenger and link from network_enablement_controller.
    • CHANGELOG: add BREAKING notes for messenger migration and metadata key rename.

Written by Cursor Bugbot for commit e8eff3b. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@cryptodev-2s
cryptodev-2sforce-pushed the cryptodev-2s/messenger/network-enablement-controller branch 2 times, most recently from 294d507 to 9130d1eCompareSeptember 10, 2025 11:13
cursor[bot]

This comment was marked as outdated.

@cryptodev-2s
cryptodev-2sforce-pushed the cryptodev-2s/messenger/network-enablement-controller branch from 9130d1e to 44f2265CompareSeptember 10, 2025 11:28
@cryptodev-2s
cryptodev-2sforce-pushed the cryptodev-2s/messenger/network-enablement-controller branch from 44f2265 to c7b3883CompareOctober 7, 2025 12:08
cursor[bot]

This comment was marked as outdated.

mcmire
mcmire previously approved these changes Oct 7, 2025

@mcmiremcmire left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

Merged via the queue into main with commit caccf12Oct 27, 2025
256 of 257 checks passed
@FrederikBolding
FrederikBolding deleted the cryptodev-2s/messenger/network-enablement-controller branch October 27, 2025 12:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@cryptodev-2s@mcmire@Mrtenz@FrederikBolding@mikesposito