Skip to content

Conversation

@cryptodev-2s
Copy link
Contributor

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

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-2s force-pushed the cryptodev-2s/messenger/network-enablement-controller branch 2 times, most recently from 294d507 to 9130d1e Compare September 10, 2025 11:13
cursor[bot]

This comment was marked as outdated.

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

This comment was marked as outdated.

@cryptodev-2s cryptodev-2s requested a review from mcmire October 7, 2025 18:53
mcmire
mcmire previously approved these changes Oct 7, 2025
Copy link
Contributor

@mcmire mcmire left a comment

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 caccf12 Oct 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 free to 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.

6 participants