Skip to content

Conversation

mikesposito
Copy link
Member

@mikesposito mikesposito commented Sep 29, 2025

Explanation

This PR migrates all remaining assets controllers to @metamask/messenger instead of @metamask/base-controller. This is part of a larger effort to migrate all controllers to use @metamask/messenger.

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 RestrictedMessenger with @metamask/messenger and adopts @metamask/base-controller/next across assets controllers and tests, updating metadata and event wiring accordingly.

  • Controllers:
    • Migrate MultichainAssetsController, MultichainBalancesController, NftDetectionController, RatesController, and TokenSearchDiscoveryDataController to use @metamask/messenger (replace messagingSystem calls and publish/subscribe) and @metamask/base-controller/next types.
    • Update state metadata to StateMetadata with includeInDebugSnapshot and adjust deriveStateFromMetadata usages.
  • Tests:
    • Replace getRestricted with namespaced Messenger + delegate; update imports and type utilities (MessengerActions, MessengerEvents, MOCK_ANY_NAMESPACE).
    • Adjust publish/subscribe/call sites and expectations accordingly.
  • Changelogs:
    • Consolidate BREAKING note to “migrate controllers to new Messenger” and note polling-controller Messenger change.
  • Misc:
    • Minor ESLint threshold adjustments; no functional logic changes beyond messenger/metadata API migration.

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

@mikesposito mikesposito mentioned this pull request Sep 29, 2025
43 tasks
@mikesposito mikesposito force-pushed the mikesposito/messenger/assets-controllers branch from 6a27d5a to 6e80728 Compare September 29, 2025 09:31
@mikesposito mikesposito marked this pull request as ready for review September 29, 2025 09:35
@mikesposito mikesposito requested review from a team as code owners September 29, 2025 09:35
cursor[bot]

This comment was marked as outdated.

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.

One thing that Cursor noticed.

AllEvents,
RootMessenger
>({
namespace: controllerName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, it does seem that we need a parent option here.

@mikesposito mikesposito requested review from a team as code owners October 20, 2025 09:44
@mikesposito mikesposito requested review from a team as code owners October 20, 2025 09:44
@socket-security
Copy link

socket-security bot commented Oct 20, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

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.

2 participants