---
title: "Update unread counts when opening one notification"
description: "Verify that reading one specific in-app notification decrements the unread count once and leaves other unread notifications unchanged."
canonical_url: "https://vostride.com/agent-library/notifications/read-unread-counter.md"
md_url: "https://vostride.com/agent-library/notifications/read-unread-counter.md"
content_kind: "recipe"
topic: "notifications"
---

# Update unread counts when opening one notification

Verify that reading one specific in-app notification decrements the unread count once and leaves other unread notifications unchanged.

## Risk

Unread counters can update optimistically without persisting the notification state, or decrement repeatedly when the same item is opened again. Seed a small exact inventory so the counter has an independent oracle.

## Fixtures

- The test account has three unread in-app notifications with unique fixture titles and no background event producers.
- The prepared inventory records each notification identifier and initial unread state.
- The application contract marks a notification read when its item is opened, rather than merely when the panel is displayed.

## Steps

1. Open the notification panel and verify all three fixture notifications are unread and the badge shows three.
2. Open Build finished alpha and verify its intended destination appears.
3. Return to notifications and verify alpha is read, the other two remain unread, and the badge shows two.
4. Open alpha again, return, and verify the badge still shows two rather than decrementing again.
5. Reload the page and verify the same read states and count persist through a prepared read-only notification check if available.

## Expected results

- Exactly one notification changes from unread to read after the first open.
- Opening an already read item is idempotent with respect to the count.
- The final count equals the two unread identifiers in the independent fixture inventory.

## False-pass traps

- A badge of two could mask marking the wrong item read; inspect individual notification states.
- Opening the panel alone must not be substituted for the defined read-trigger action.

## Cleanup

- Delete the three test notifications and stop their fixture event source.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Notification QA recipes](/agent-library/notifications.md)
- [Software factory QA library](/agent-library.md)
