Skip to content

feat(notifications): fixing pwa notifications being repeated#44

Merged
prathameshkurunkar7 merged 2 commits into
developfrom
try-fixing-pwa-notifications-being-repeated
Apr 17, 2026
Merged

feat(notifications): fixing pwa notifications being repeated#44
prathameshkurunkar7 merged 2 commits into
developfrom
try-fixing-pwa-notifications-being-repeated

Conversation

@prathameshkurunkar7

@prathameshkurunkar7 prathameshkurunkar7 commented Apr 17, 2026

Copy link
Copy Markdown
Member

Identified the issue after so so long -

This is a well known issue in the community, it's just that fix was not so simple without breaking anything else.

https://stackoverflow.com/questions/66697332/firebase-web-push-notifications-is-triggered-twice-when-using-onbackgroundmessag#:~:text=3%20Comments&text=If%20you%20using%20Firebase%20Admin,send%20some%20data%20like%20below.&text=With%20FCM%2C%20you%20can%20send,property%20notification%20from%20the%20payload.&text=With%20that%2C%20FCM%20will%20not,doesn't%20has%20property%20notification%20.

https://firebase.google.com/docs/cloud-messaging/web/receive-messages

firebase/firebase-js-sdk#6670

So when the payload has both notification + data:

FCM's built-in push handler auto-displays the notification on the browser.
The Raven web SW's onBackgroundMessage fires and (based on the duplicate you're seeing in the screenshot) also calls self.registration.showNotification(...).
User sees two notifications — one from FCM's default handler, one from the custom SW.

But we can't simply remove notification as APNS and Android both have different configuration from web.

Requires a small but probably breaking change on client as well - The-Commit-Company/raven#2126

@prathameshkurunkar7 prathameshkurunkar7 merged commit f12c6e3 into develop Apr 17, 2026
1 check failed
@prathameshkurunkar7 prathameshkurunkar7 deleted the try-fixing-pwa-notifications-being-repeated branch April 17, 2026 17:38
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.

1 participant