Summary
Clicking a notification to mark it as read currently waits for the server response before the unread indicator clears, making the action feel slow. An optimistic update should clear the indicator immediately and roll back if the request fails.
Scope
- Implement optimistic update in
useMarkNotificationRead using React Query's onMutate / onError / onSettled
- Cancel in-flight notification list queries before applying the optimistic update
- Roll back to unread state if the mutation fails
- Decrement the nav bell unread count optimistically and restore it on rollback
- Invalidate the notification list cache when the mutation settles
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Clicking a notification to mark it as read currently waits for the server response before the unread indicator clears, making the action feel slow. An optimistic update should clear the indicator immediately and roll back if the request fails.
Scope
useMarkNotificationReadusing React Query'sonMutate/onError/onSettledAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram