Skip to content

Conversation

cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Oct 13, 2025

Explanation

This PR migrates AccountActivityService and BackendWebSocketService 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

Replace base-controller RestrictedMessenger with @metamask/messenger across services, tests, and exports, with breaking type/constant removals and dependency/config updates.

  • Core:
    • Migrate AccountActivityService and BackendWebSocketService to @metamask/messenger (Messenger), replacing RestrictedMessenger from @metamask/base-controller.
    • Update service messenger typedefs (AccountActivityServiceMessenger, BackendWebSocketServiceMessenger) and allowed action/event type aliases (AllowedActions, AllowedEvents).
    • Remove exports of controller-messenger-specific type aliases/constants from index.ts and AccountActivityService.
  • Tests:
    • Rework test messengers to use @metamask/messenger with root/child namespaces and delegate; add helpers like getRootMessenger.
    • Adjust publish calls (synchronous) and type plumbing; update mocks/registrations accordingly.
  • Config/Deps:
    • Add dependency @metamask/messenger; remove reliance on @metamask/base-controller; update TS references to ../messenger.
    • Update yarn.lock for new dependency.
  • Changelog:
    • Document BREAKING changes: adoption of new Messenger and removal of exported controller-messenger-specific types/constants.

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

@cryptodev-2s cryptodev-2s changed the title refactor: migrate `{AccountActivity,BackendWebSocket}Service to @metam… refactor: migrate {AccountActivity,BackendWebSocket}Service to @metamask/messenger Oct 13, 2025
@cryptodev-2s cryptodev-2s self-assigned this Oct 13, 2025
@cryptodev-2s cryptodev-2s marked this pull request as ready for review October 13, 2025 17:55
@cryptodev-2s cryptodev-2s requested review from a team as code owners October 13, 2025 17:55
@cryptodev-2s cryptodev-2s force-pushed the cryptodev-2s/messenger/core-backend branch from 827f7f5 to 9a2a804 Compare October 13, 2025 17:55
@cryptodev-2s cryptodev-2s force-pushed the cryptodev-2s/messenger/core-backend branch from 9a2a804 to daec53e Compare October 13, 2025 17:55
@cryptodev-2s cryptodev-2s requested a review from Kriys94 October 13, 2025 17:58
Mrtenz
Mrtenz previously approved these changes Oct 14, 2025
Kriys94
Kriys94 previously approved these changes Oct 17, 2025
Copy link
Contributor

@Kriys94 Kriys94 left a comment

Choose a reason for hiding this comment

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

LGTM :)

@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: Race Conditions in Test Asynchronous Operations

Removing await from rootMessenger.publish() calls in tests can introduce race conditions. Asynchronous event handlers triggered by the publish might not complete before subsequent assertions, potentially causing test flakiness, even with completeAsyncOperations() called afterward.

Additional Locations (6)

Fix in Cursor Fix in Web

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.

4 participants