# Bug COMMS-1127 - Browser notifications for the same work package stack up in Safari instead of replacing each other

Project: Stream Communicator
Status: rejected
URL: https://community.openproject.org/work_packages/COMMS-1127

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions |  |
| Observed in versions |  |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee | Kabiru Mwenja |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

In Safari on macOS, a push for a work package that already has a browser notification adds a second entry to Notification Centre instead of replacing the first one. A work package with ongoing activity collects one entry per push.

### Steps to reproduce

Preconditions: the `progressive_web_app` feature flag is on and browser notifications are enabled in the administration.

1.  As user A on macOS, open OpenProject in Safari, add it to the Dock and enable browser notifications for this device.
    
2.  As user B, assign a work package to user A. Wait for the browser notification to arrive.
    
3.  As user B, mention user A in a comment on the same work package. Wait for the next browser notification.
    
4.  Open Notification Centre.
    

### What is the buggy behavior?

*   Notification Centre shows two entries for the same work package: the first one (&quot;B assigned you&quot;) and the new one (&quot;2 updates&quot;).
    
*   Each further push for that work package adds another entry.
    

### What is the expected behavior?

*   There is one entry per work package. A new notification replaces the earlier one for the same work package, as it does in Chrome.
    

### Technical notes

*   The worker gives every work package one notification tag per user and relies on the browser to replace a notification that has the same tag ([`Notification.tag`](https://developer.mozilla.org/en-US/docs/Web/API/Notification/tag), [Notifications API standard](https://notifications.spec.whatwg.org/)). WebKit does not do that in Notification Centre; it only replaces the entry in the list returned by `getNotifications()` ([WebKit bug 258922](https://bugs.webkit.org/show_bug.cgi?id=258922), open since July 2023).
    
*   Proposed fix: before the worker shows a notification, it closes the open notification with the same tag. This is only done in browsers that do not replace it themselves; Chrome keeps its own replacement, because closing first makes the notification disappear and slide in again there. The fix relies on `Notification.close()` being handled for web push in Safari ([WebKit bug 277171](https://bugs.webkit.org/show_bug.cgi?id=277171), fixed in 2024).
    
*   To check during implementation: closing removes the entry from Notification Centre in Safari, both for the web app in the Dock and for Safari itself, and Chrome behaves as before. In particular, a silent refresh must not alert again.
    
*   Probably related, not verified: the earlier entry can no longer be closed once the work package is read, because the worker no longer gets it from `getNotifications()`.
    

### Out of scope

*   Safari on iOS and iPadOS.
    
*   Notifications that the browser no longer reports as open. Removing a notification after its work package was read stays best effort.
    

### Screenshots and other files

<img class="image_resized op-uc-image op-uc-image_inline" style="width:277px;" src="/api/v3/attachments/926999/content">

### Environment information

*   Found on qa.openproject-edge.com (dev)
    
*   Browser: Safari, web app added to the Dock
    
*   Operating system: macOS
    

### Links

*   [WebKit bug 258922](https://bugs.webkit.org/show_bug.cgi?id=258922): Push notifications with same tag do not replace each other (status NEW, last comment July 2026)
    
*   [WebKit bug 319860](https://bugs.webkit.org/show_bug.cgi?id=319860): Tag-based notification coalescing does not work with Declarative Web Push on iOS 18.4 (status NEW, reported July 2026); the same behavior, so switching to Declarative Web Push would not avoid it
    
*   [WebKit bug 277171](https://bugs.webkit.org/show_bug.cgi?id=277171): Handle Notification.close in webpushd (fixed July 2024)
