Description
Ensure that the is_read flag is correctly initialised, propagated, and updated across the full lifecycle of a notification — from creation through WebSocket delivery to REST state updates — and that the unread count is always consistent with actual row state.
User Story
As a user, I want to see a reliable count of notifications I haven't read yet, and I want that count to update immediately when I mark notifications as read, so that I always have an accurate picture of what still needs my attention.
Acceptance Criteria
Definition of Done
Assumptions and Constraints
- Assumption: Database-level consistency is sufficient — no in-memory cache of unread counts is needed at this stage.
- Constraint: The
read-all operation must be bounded to the authenticated user's rows only.
Dependencies
No response
Additional Notes
No response
Description
Ensure that the
is_readflag is correctly initialised, propagated, and updated across the full lifecycle of a notification — from creation through WebSocket delivery to REST state updates — and that the unread count is always consistent with actual row state.User Story
As a user, I want to see a reliable count of notifications I haven't read yet, and I want that count to update immediately when I mark notifications as read, so that I always have an accurate picture of what still needs my attention.
Acceptance Criteria
is_read = false.notification.createdWebSocket message includesis_read: falseso the UI can immediately increment its local unread count without a separate API call.PATCH /notifications/:id/readon an already-read notification returns 200 with no error.PATCH /notifications/read-allexecutes as a singleUPDATEquery. It must not leave partial state if interrupted.GET /notifications/unread-countreflects the true database state, not a cached value, so it is always consistent after any read/delete operation.mark-readcalls for the same notification do not produce an error or inconsistent state.Definition of Done
Assumptions and Constraints
read-alloperation must be bounded to the authenticated user's rows only.Dependencies
No response
Additional Notes
No response