refactor: improve push notification received utils#7275
Merged
Prithpal-Sooriya merged 4 commits intomainfrom Dec 1, 2025
Merged
refactor: improve push notification received utils#7275Prithpal-Sooriya merged 4 commits intomainfrom
Prithpal-Sooriya merged 4 commits intomainfrom
Conversation
Prithpal-Sooriya
commented
Dec 1, 2025
Contributor
Author
There was a problem hiding this comment.
Removing as these are never used or ever exported. It is safe to remove without introducing a breaking change.
...tification-services-controller/src/NotificationServicesPushController/web/push-utils.test.ts
Show resolved
Hide resolved
Prithpal-Sooriya
commented
Dec 1, 2025
Comment on lines
+135
to
+136
| // TODO - provide open-api unfied backend/frontend types | ||
| // TODO - we will replace the underlying Data payload with the same Notification payload used by mobile |
Contributor
Author
There was a problem hiding this comment.
juanmigdr
approved these changes
Dec 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
We are throwing an error when subscribing the the push notification background listener. Instead we shall fail silently.
I've also added TODOs for areas to improve for push notifications
Notificationpush payload used in mobile. This handler can then just be responsible for analytics and not actual push logic.References
https://consensyssoftware.atlassian.net/browse/ASSETS-1857
Checklist
Note
Harden web push notification utilities with defensive parsing and silent failure, remove legacy service-worker module, and update tests and changelog.
web/push-utils.ts):listenToPushNotificationsReceivedhandler optional and guard against unsupported Firebase.JSON.parse(... ?? 'null')), validate withisOnChainRawNotification, and process viasafeProcessNotificationwith early returns on invalid data.log.errorinstead.services/push/push-web.tsandservices/push/push-web.test.ts.web/push-utils.test.tsto cover invalid payload cases and adjusted handler behavior; remove error-throw assertions.CHANGELOG.mdto note background push utilities now handle more edge cases without throwing.Written by Cursor Bugbot for commit f2f8890. This will update automatically on new commits. Configure here.