Problem/Motivation

On Android Chrome, tapping a Web Push notification opens the target URL, including in PWA standalone mode, but the notification remains visible in the system notification tray/shade. The bug is most consistently reproduced when the notification link targets a PWA, where clients.openWindow() behaviour differs from a regular browser tab.

Steps to reproduce

Prerequisites: drupal/pwa module installed and enabled; site configured as a PWA.

  1. Install the site as a PWA on Android Chrome and subscribe to Web Push.
  2. Trigger a push that uses service_worker_notification.js (showNotification + notificationclick handler).
  3. Tap the notification when it appears.
  4. Observe: the PWA opens the URL, but the notification entry remains in the notification tray/shade until dismissed manually.
  5. Proposed resolution

    In js/service_worker_notification.js, inside the notificationclick listener, call event.notification.close() before event.waitUntil(...) so the notification is explicitly dismissed when the user acts on it. This matches common Service Worker / Notification API guidance for click handling.

    Remaining tasks

  6. Maintainer review for any platform-specific concerns.
  7. Confirm behaviour on Android Chrome (primary target) and desktop Chrome.
  8. User interface changes

    None (behavioural fix only).

    API changes

    None.

    Data model changes

    None.

Comments

oscarclement created an issue.