Skip to content

fix(notifications)!: improve notification handling in service worker#2126

Merged
prathameshkurunkar7 merged 1 commit intodevelopfrom
fix-pwa-notifications-duplication-issue
Apr 17, 2026
Merged

fix(notifications)!: improve notification handling in service worker#2126
prathameshkurunkar7 merged 1 commit intodevelopfrom
fix-pwa-notifications-duplication-issue

Conversation

@prathameshkurunkar7
Copy link
Copy Markdown
Member

@prathameshkurunkar7 prathameshkurunkar7 commented Apr 17, 2026

Why

Per Firebase docs, a push with both notification and data payload makes FCM's default handler auto-display a notification and trigger onBackgroundMessage — our SW then renders a second one via showNotification(), so users see two notifications for every push on PWAs.

Paired with the backend change (Raven Cloud now sends Web clients a data-only payload), this ensures FCM no longer auto-displays and our SW remains the sole renderer — exactly one notification per push, with all existing click routing / Chrome-vs-others behavior preserved.

On Rollout

We need some way to communicate this to everyone using Raven to update to new version once this is merged. @nikkothari22

@nikkothari22
Copy link
Copy Markdown
Member

Maybe we should remove the option for Frappe Cloud as a notification service altogether. Always have them select Raven since we maintain this.

@prathameshkurunkar7
Copy link
Copy Markdown
Member Author

Maybe we should remove the option for Frappe Cloud as a notification service altogether. Always have them select Raven since we maintain this.

Yeah, created a separate issue for that, will do that separately. Need to first merge and check whether this completely resolves the PWA duplicate issue on prod

@prathameshkurunkar7 prathameshkurunkar7 merged commit d1a9df6 into develop Apr 17, 2026
@prathameshkurunkar7 prathameshkurunkar7 deleted the fix-pwa-notifications-duplication-issue branch April 17, 2026 17:40
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