You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A cold push click does not mark the notification read #312
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 as a query parameter. In public/service-worker.js, add it to the URL that clients.openWindow opens. On load, after the session exists, mark it read the same way handleNotificationClick in useNotificationClickBridge.ts does. Then strip the parameter, as stripChatDeepLinkFromUrl does, so Share never copies it.
Do not mark it read from the service worker. It has no user session, and it must never hold the service-role key.
Check
Close every app window. Send a push, then click it. The pad opens, and the bell and badge drop by 1.
#355 device check, 2026-11-03. Local stack, production build, desktop Chrome 156 in a throwaway profile, app installed and standalone. Push is real: subscription endpoint on fcm.googleapis.com, a mention row went through the worker, and the notification reached the service worker about 11 s later ("docsplus_qa402_local mentioned you").
Service worker, every window closed: not proven.clients.matchAll returned [], and the worker built the right URL: /hovercard-switch-r1-light-in?chatroom=X5oruGFz2DZMZcDES0W¬ification_id=139cec0d-…. The click was synthetic (NotificationEvent('notificationclick')), because this Mac gives no assistive access to click a real macOS notification. So clients.openWindow failed with InvalidAccessError: Not allowed to open a window. A real OS click carries user activation, so this needs one real click.
Page side: pass. Opening that exact URL marked 139cec0d-… read (readed_at 12:40:01) and stripped notification_id from the URL. An earlier dev run did the same (4 → 3 unread).
Left: one real notification click with every app window closed.
Device check, 2026-11-03. Production (1b05cb24d), desktop Chrome on macOS. Every docs.plus window was closed. A real OS click on three push notifications opened the pad at the right spot and marked each one read: 7b42a0ef 18:00:07, f050aa50 18:00:11 and 459267ec 18:00:15 UTC. This passes the last open check, so I'm closing this issue.
Activity
HMarzban commentedon Oct 25, 2026
Built and committed on local main. Awaits the maintainer's final push.
Remaining gates: the webapp deploy, then a real push click with every window closed, in the device session.
fix(webapp): mark a push notification read when its click opens a new…
refactor: cross-review wave-1
HMarzban commentedon Nov 3, 2026
Status, 2026-11-03. The cold-click mark-read fix shipped in
bcc19b4e0, with a review follow-up in5cfcc023d. It is pushed and deployed. Left:HMarzban commentedon Nov 3, 2026
#355 device check, 2026-11-03. Local stack, production build, desktop Chrome 156 in a throwaway profile, app installed and standalone. Push is real: subscription endpoint on
fcm.googleapis.com, amentionrow went through the worker, and the notification reached the service worker about 11 s later ("docsplus_qa402_local mentioned you").clients.matchAllreturned[], and the worker built the right URL:/hovercard-switch-r1-light-in?chatroom=X5oruGFz2DZMZcDES0W¬ification_id=139cec0d-…. The click was synthetic (NotificationEvent('notificationclick')), because this Mac gives no assistive access to click a real macOS notification. Soclients.openWindowfailed withInvalidAccessError: Not allowed to open a window.A real OS click carries user activation, so this needs one real click.139cec0d-…read (readed_at12:40:01) and strippednotification_idfrom the URL. An earlier dev run did the same (4 → 3 unread).Left: one real notification click with every app window closed.
HMarzban commentedon Nov 3, 2026
Device check, 2026-11-03. Production (
1b05cb24d), desktop Chrome on macOS. Every docs.plus window was closed. A real OS click on three push notifications opened the pad at the right spot and marked each one read:7b42a0ef18:00:07,f050aa5018:00:11 and459267ec18:00:15 UTC. This passes the last open check, so I'm closing this issue.