# Feature COMMS-1136 - Clear the app badge when the installed app is quit

Project: Stream Communicator
Status: new
URL: https://community.openproject.org/work_packages/COMMS-1136

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions |  |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Use cases

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

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

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** a user of the installed OpenProject app
**I want** the app badge to disappear when I quit the app
**so that** a closed app does not keep showing a count that nothing updates anymore

**Acceptance criteria**

*   When the last page of the installed app is closed, the app badge is cleared.
*   When the app is opened again, the badge shows the current unread count as before.
*   With browser notifications enabled, a push that arrives while the app is closed sets the badge again, together with its notification.
*   Navigating inside the app does not leave the badge cleared; a brief flicker on a full page load is acceptable.
*   A page restored from the back/forward cache keeps its badge.
*   Clearing is best effort: after a crash, force quit or restart the badge may stay until the next launch.

**Technical notes**

*   The web has no "app quit" event. The closest signal is `pagehide` on the window; clear the badge there unless `event.persisted` is true.
*   Belongs in `AppBadgeService` (`frontend/src/app/features/in-app-notifications/bell/app-badge.service.ts`), page side only. No service worker change.
*   With several app windows open, closing one clears the badge; the next bell poll in a remaining window restores it.
*   `clearAppBadge()` is asynchronous. Verify in a Safari web app (macOS and iOS) and in Chrome that the call completes on quit.

**Permissions and visibility considerations**

*   Affects only users who run OpenProject as an installed app with the `progressive_web_app` feature flag active.
*   No effect in a regular browser tab.

**Translation considerations**

*   None, no user-facing text.

**Out of scope**

*   Keeping the badge of a closed app in sync when notifications are read elsewhere.
*   Suppressing the badge for pushes that arrive while the app is closed.
