Skip to content

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Sep 15, 2025

Explanation

The Messenger class in @metamask/messenger has been updated to accept an optional captureException constructor parameter. This is now used to capture subscriber errors, instead of throwing them in a setTimeout (which would cause a crash on mobile).

References

This is the implementation of the 2nd option in this ADR: https://github.com/MetaMask/decisions/blob/main/decisions/core/0016-core-classes-error-reporting.md#optional-captureexception-constructor-parameter-that-inherits-from-parent

Relates to #6613

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

@Gudahtt Gudahtt force-pushed the add-messenger-error-reporter branch 4 times, most recently from 48dd51d to cd4e973 Compare September 15, 2025 19:50
@Gudahtt Gudahtt marked this pull request as ready for review September 15, 2025 19:50
@Gudahtt Gudahtt requested a review from a team as a code owner September 15, 2025 19:50
@Gudahtt Gudahtt force-pushed the add-messenger-error-reporter branch from cd4e973 to 5265f8d Compare September 15, 2025 20:55
Copy link
Contributor

@cryptodev-2s cryptodev-2s left a comment

Choose a reason for hiding this comment

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

LGTM!

The `Messenger` class in `@metamask/messenger` has been updated to
accept an optional `captureException` constructor parameter. This is
now used to capture subscriber errors, instead of throwing them in a
`setTimeout` (which would cause a crash on mobile).

This is the implementation of the 2nd option in this ADR: https://github.com/MetaMask/decisions/blob/core-classes-error-reporting-strategy/decisions/core/0016-core-classes-error-reporting.md#optional-captureexception-constructor-parameter-that-inherits-from-parent
@Gudahtt Gudahtt force-pushed the add-messenger-error-reporter branch from 5265f8d to 57122d1 Compare September 16, 2025 16:28
@Gudahtt Gudahtt enabled auto-merge (squash) September 16, 2025 16:28
@Gudahtt Gudahtt merged commit c253bbe into main Sep 16, 2025
239 checks passed
@Gudahtt Gudahtt deleted the add-messenger-error-reporter branch September 16, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants