Skip to content

Conversation

mikesposito
Copy link
Member

@mikesposito mikesposito commented Sep 4, 2025

Explanation

This PR migrates ErrorReportingService 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

Migrate ErrorReportingService and tests to @metamask/messenger, add the dependency, and document the breaking change.

  • ErrorReportingService:
    • Migrate from @metamask/base-controller RestrictedMessenger to @metamask/messenger Messenger across src/error-reporting-service.ts.
    • Update JSDoc examples to new Messenger API (namespaces, generics, delegation, and messenger.call).
  • Tests:
    • Update packages/error-reporting-service/src/error-reporting-service.test.ts to use @metamask/messenger types and construction.
  • Package:
    • Add dependency @metamask/messenger in package.json.
  • Changelog:
    • Note breaking change: adoption of new Messenger API.

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

@mikesposito mikesposito force-pushed the mikesposito/messenger/error-reporting-service branch from cc65bbf to 74e5fca Compare September 4, 2025 11:34
@mikesposito mikesposito mentioned this pull request Sep 4, 2025
43 tasks
@mikesposito mikesposito marked this pull request as ready for review September 4, 2025 11:35
@mikesposito mikesposito requested a review from a team as a code owner September 4, 2025 11:35
Comment on lines +98 to 105
* type AllActions = MessengerActions<ErrorReportingServiceMessenger>;
*
* type AllEvents = MessengerEvents<ErrorReportingServiceMessenger>;
*
* type RootMessenger = Messenger<'Root', AllActions, AllEvents>;
*
* // Create a global messenger.
* const globalMessenger = new Messenger();
Copy link
Contributor

@mcmire mcmire Sep 10, 2025

Choose a reason for hiding this comment

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

Maybe we can simplify this a bit? Also in this example should we go with global messenger instead of root messenger to match the variable name below this?

Suggested change
* type AllActions = MessengerActions<ErrorReportingServiceMessenger>;
*
* type AllEvents = MessengerEvents<ErrorReportingServiceMessenger>;
*
* type RootMessenger = Messenger<'Root', AllActions, AllEvents>;
*
* // Create a global messenger.
* const globalMessenger = new Messenger();
* type GlobalMessenger = Messenger<
* 'Global',
* MessengerActions<ErrorReportingServiceMessenger>,
* MessengerEvents<ErrorReportingServiceMessenger>
* >;
*
* // Create a global messenger.
* const globalMessenger: GlobalMessenger = new Messenger();

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