Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(notification-services-push-controller): Add missing messenger action/events #4641

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Aug 27, 2024

Explanation

Fixes various errors in the NotificationServicesPushController:

References

Changelog

@metamask/notification-services-controller (major)

Added

  • Add and export types NotificationServicesPushControllerGetStateAction, NotificationServicesPushControllerStateChangeEvent (#4641)

Changed

  • BREAKING: Rename NotificationServicesPushControllerPushNotificationClicked type to NotificationServicesPushControllerPushNotificationClickedEvent (#4641)
  • BREAKING: Narrow AllowedEvents type for NotificationServicesPushControllerMessenger to never (#4641)
  • NotificationServicesPushControllerMessenger must allow internal event NotificationServicesPushControllerStateChangeEvent (#4641)

Fixed

  • BREAKING: Fix package-level export for NotificationServicesPushController from "NotificationsServicesPushController" to "NotificationsServicesPushController" (#4641)
  • BREAKING: Replace incorrectly-defined getState action in the Actions type for NotificationServicesPushControllerMessenger with new NotificationServicesPushControllerGetStateAction type (#4641)

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 highlighted breaking changes using the "BREAKING" category above as appropriate

@MajorLift MajorLift self-assigned this Aug 27, 2024
@MajorLift MajorLift requested a review from a team as a code owner August 27, 2024 19:08
@MajorLift MajorLift requested review from a team August 27, 2024 19:09
@Prithpal-Sooriya
Copy link
Contributor

Thank you for these changes! LMK when this needs a review. Or feel free to merge with another external reviewer 🫡

@@ -1,2 +1,2 @@
export * as NotificationServicesController from './NotificationServicesController';
export * as NotificationsServicesPushController from './NotificationServicesPushController';
export * as NotificationServicesPushController from './NotificationServicesPushController';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use named exports instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The notifications team is pursuing a different scheme with organizing their exports. It looks like they're planning to define export subpaths instead of enumerating named exports (see #4604).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, it's a bit messy for now. Once subpath exports get it, we'll clean up the imports used.

@MajorLift MajorLift merged commit 9814f17 into main Aug 28, 2024
117 checks passed
@MajorLift MajorLift deleted the fix/notification-services-push-controller/missing-actions-events branch August 28, 2024 09:08
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.

Fix controllers with missing or incorrect messenger-related types
3 participants