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

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-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 mentioned this pull request Oct 13, 2025
43 tasks
@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

@cryptodev-2s cryptodev-2s added this pull request to the merge queue Oct 27, 2025
Merged via the queue into main with commit ed168cf Oct 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 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.

5 participants