Problem
A push click with no open app window does not mark the notification read.
public/service-worker.js posts NOTIFICATION_CLICK only to an existing window. With no window it calls clients.openWindow(url) and posts nothing. The mark-read path in usePushNotifications.ts never runs. So the bell and the app icon badge (#258) keep the old count after a cold launch from a push.
Fix
Carry the notification_id in the opened URL (for example a query parameter), and mark it read on load. Or mark it read from the worker with the service role.
Check
Close every app window. Send a push, then click it. The pad opens, and the bell and badge drop by 1.
Part of #249.
Problem
A push click with no open app window does not mark the notification read.
public/service-worker.jspostsNOTIFICATION_CLICKonly to an existing window. With no window it callsclients.openWindow(url)and posts nothing. The mark-read path inusePushNotifications.tsnever runs. So the bell and the app icon badge (#258) keep the old count after a cold launch from a push.Fix
Carry the
notification_idin the opened URL (for example a query parameter), and mark it read on load. Or mark it read from the worker with the service role.Check
Close every app window. Send a push, then click it. The pad opens, and the bell and badge drop by 1.
Part of #249.