Skip to content

refactor: migrate {AccountActivity,BackendWebSocket}Service to @metamask/messenger - #6823

Merged
cryptodev-2s merged 8 commits into
mainfrom
cryptodev-2s/messenger/core-backend
Oct 27, 2025
Merged

refactor: migrate {AccountActivity,BackendWebSocket}Service to @metamask/messenger#6823
cryptodev-2s merged 8 commits into
mainfrom
cryptodev-2s/messenger/core-backend

Conversation

@cryptodev-2s

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

Copy link
Copy Markdown
Contributor

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

Replaces base-controller messenger with @metamask/messenger across core-backend services, updates types/exports, tests, dependencies, and docs with breaking changes noted.

  • Core Backend Services:
    • Migrate AccountActivityService and BackendWebSocketService to @metamask/messenger (Messenger) replacing RestrictedMessenger.
    • Update messenger wiring: new root/child messengers, delegate, publish/subscribe/call usage; adjust connection, subscription, and event handling accordingly.
    • Refactor tests to use new messenger APIs and types.
  • API/Types (BREAKING):
    • Remove controller-messenger-specific exported aliases/constants: BackendWebSocketServiceAllowedActions/Events, AccountActivityServiceAllowedActions/Events, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS/ EVENTS.
    • Rename metadata property anonymous to includeInDebugSnapshot.
  • Dependencies/Build:
    • Remove @metamask/base-controller; add @metamask/messenger and reference in tsconfig.
    • Bump @metamask/profile-sync-controller to ^25.1.2.
  • Docs:
    • Update README dependency graph: core_backend --> messenger; add eip_7702_internal_rpc_middleware --> controller_utils.

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

@cryptodev-2scryptodev-2s changed the title refactor: migrate `{AccountActivity,BackendWebSocket}Service to @metam…refactor: migrate {AccountActivity,BackendWebSocket}Service to @metamask/messengerOct 13, 2025
@cryptodev-2scryptodev-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 ownersOctober 13, 2025 17:55
@cryptodev-2s
cryptodev-2sforce-pushed the cryptodev-2s/messenger/core-backend branch from 827f7f5 to 9a2a804CompareOctober 13, 2025 17:55
@cryptodev-2s
cryptodev-2sforce-pushed the cryptodev-2s/messenger/core-backend branch from 9a2a804 to daec53eCompareOctober 13, 2025 17:55
@cryptodev-2scryptodev-2s mentioned this pull request Oct 13, 2025
43 tasks
Mrtenz
Mrtenz previously approved these changes Oct 14, 2025
Kriys94
Kriys94 previously approved these changes Oct 17, 2025

@Kriys94Kriys94 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM :)

@cursor

cursorBot commented Oct 23, 2025

Copy link
Copy Markdown

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 CursorFix in Web

@cryptodev-2s
cryptodev-2s added this pull request to the merge queueOct 27, 2025
Merged via the queue into main with commit ed168cfOct 27, 2025
256 of 257 checks passed
@cryptodev-2s
cryptodev-2s deleted the cryptodev-2s/messenger/core-backend branch October 27, 2025 13:06
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.

4 participants

@cryptodev-2s@Mrtenz@Kriys94@mikesposito