Skip to content

A cold push click does not mark the notification read #312

Description

@HMarzban

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ChatRelated to chat featuresbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions