Uh oh!
There was an error while loading. Please reload this page.
feat: update notification-services-controller to support new Segment schema - #8944
Conversation
9dbca22 to
9811cb9Comparee51bf05 to
16656edCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
zelkibuilds
left a comment
There was a problem hiding this comment.
Left some open questions in PR description + code
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
b1c77d8 to
81b5f29CompareUh oh!
There was an error while loading. Please reload this page.
zelkibuilds
commented
Jun 8, 2026
@metamaskbot publish-preview |
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Uh oh!
There was an error while loading. Please reload this page.
zelkibuilds
commented
Jun 9, 2026
@metamaskbot publish-preview |
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
zelkibuilds
commented
Jun 16, 2026
@metamaskbot publish-preview |
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
zelkibuilds
commented
Jun 16, 2026
@metamaskbot publish-preview |
4c965c0 to
bb35b41CompareUh oh!
There was an error while loading. Please reload this page.
zelkibuilds
commented
Jul 10, 2026
@metamaskbot publish-previews |
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 069d5ce. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
zelkibuilds
commented
Jul 20, 2026
@metamaskbot publish-previews |
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| * @param notification - a raw or processed notification. | ||
| * @returns the normalised subtype string. | ||
| */ | ||
| export function getNotificationSubtype( |
There was a problem hiding this comment.
Is it worth adding a small getNotificationType helper to avoid the confusion between subtypes and types in the clients?
There was a problem hiding this comment.
getNotificationSubtype exists because notification_subtype needs to be derived and has to be computed from different source fields depending on the shape. notification.type, on the other hand, is always set upstream and directly readable on every notification shape, so there's nothing to derive unless I'm missing some context.
Would getNotificationType mainly be for ergonomics? Giving clients a consistent helper to read type the same way they'd call getNotificationSubtype for subtype?
There was a problem hiding this comment.
Yes that's my suggestion. But feel free not to add it if you don't find it relevant

Explanation
Implements the
notification-services-controllerportion of the notifications-analytics rework (PLAN §5): push events expose first-class analytics fields, and the in-app model gains anotification_subtype.web/push-utils.tsnow reads the top-level FCM fields viatoPushAnalyticsPayloadinstead of JSON-parsingdata["data"]behind theisOnChainRawNotificationgate. All push kinds (on-chain/platform/snap/feature-announcement) flow through one path; the §5.5 banner-display gap goes away.PushAnalyticsPayload(notification_id,notification_type,notification_subtype,profile_id?,chain_id?,deeplink?). Both push events (onNewNotifications,pushNotificationClicked) now carry[PushAnalyticsPayload];createSubscribeToPushNotificationshandler signatures updated to match.notification_subtypefield toBaseNotification/INotification, populated in the processors via a newgetNotificationSubtype(n)helper (on-chain kind /snap/features_announcement/ platform fallback). Type-checking guarantees every processed notification carries it.id/typeareunchanged.
metadataparsing path and the nested blob.onNewNotificationssubscriber now re-fetches viafetchAndUpdateMetamaskNotifications()instead of inserting the payload.Open questions
uuid()inprocessSnapNotification— keep client-side or move upstream?References
metamask-extension— §7 (feat: new segment schema support metamask-extension#43132)metamask-mobile— §6 (feat: support new notification services controller + segment schema metamask-mobile#31204)va-mmcx-notify-push-servicesfor the top-level FCM keysChecklist
Note
High Risk
Breaking messenger and push subscription APIs plus a change from local push merge to API refetch for the inbox; consumers must adopt new payload shapes and coordinate with push-services FCM key format.
Overview
Aligns notification-services-controller with the notifications-analytics rework: push flows expose first-class Segment fields, and in-app notifications carry a normalized
notification_subtype.Push (breaking). Web FCM handling drops nested
data["data"]/ metadata parsing and buildsPushAnalyticsPayloadfrom top-level keys viatoPushAnalyticsPayload. Messenger eventsonNewNotificationsandpushNotificationClicked, pluscreateSubscribeToPushNotificationshandlers, now passPushAnalyticsPayloadinstead ofINotification.Inbox on push. Because pushes no longer include the full notification body,
onNewNotificationstriggersfetchAndUpdateMetamaskNotifications()instead of merging the push into the list, with coalescing so at most one fetch runs and one refetch is queued while a fetch is in flight.In-app model.
notification_subtypeis required onBaseNotification/INotification, set in processors throughgetNotificationSubtype(on-chain kind, platform server subtype, snap / feature-announcement type).getNotificationSubtypeandtoPushAnalyticsPayloadare exported for extension and mobile consumers.Reviewed by Cursor Bugbot for commit ae4885f. Bugbot is set up for automated code reviews on this repo. Configure here.