Bug Report: Notification "Mark All Read" Fails to Update UI and State
- Dominant language
- Python
- Stars
- 562
- Forks
- 410
- Avg merge
- 22h 15m
- Merged PRs (30d)
- 197
Description
### Information about bug
### Bug Report: Notification "Mark All Read" Fails to Update UI and State
### Environment
- **URL**: https://cloud.frappe.io/dashboard/groups/bench-32731/deploys/4olrqmc2mr
- **Timestamp**: 2026-05-10T07:45:23Z
### Description
The "Mark All Read" action (triggered by the double-check icon in the Notifications popover) is successfully closing the popover menu but failing to update the `unread_count` and the read status of individual notification items. This suggests a failure in the API callback or a lack of state re-validation in the frontend framework (Frappe/Vue). The UI persists in showing old messages as "Unread" even after the action is performed.
### Steps to Reproduce
1. Log into the Frappe Cloud Dashboard.
2. Click on the **Notifications** icon in the sidebar (showing a badge count of 6).
3. Click the **Mark all as read** (double-check) icon at the top of the Notifications popover.
4. Observe that the popover closes automatically.
5. Re-open the Notifications popover or check the sidebar badge.
### Expected vs. Actual
- **Expected**: The notification badge count should reset to 0, and all messages within the popover should transition to a 'read' visual state.
- **Actual**: The popover closes, but the badge count remains at 6, and messages remain highlighted as unread upon re-opening.
### Suggested Fix
Ensure the "Mark All Read" click handler properly awaits the API response before closing the popover, and explicitly triggers a refresh of the notification list state.
```javascript
// Suggested logic update for the notification component
async function markAllAsRead() {
try {
await frappe.call({
method: "frappe.desk.doctype.notification_log.notification_log.mark_all_as_read",
});
// Force update the local state or re-fetch count
this.unread_count = 0;
this.notifications.forEach(n => n.read = 1);
} catch (error) {
console.error("Failed to mark notifications as read", error);
}
}
### Steps to Reproduce
Steps to Reproduce
Navigate to the Frappe Cloud Dashboard.
Locate the Notifications icon in the left-hand sidebar (currently showing a badge of 5).
Click the icon to open the Notifications popover.
Click the Mark all as read (double-check) icon at the top of the popover menu.
Observe that the popover closes immediately.
Re-open the Notifications popover or check the sidebar badge.
Expected vs. Actual
Expected: The notification badge should disappear (count becomes 0), and all messages should be marked as read.
Actual: The popover closes, but the sidebar badge still shows 5, and the messages remain in the "Unread" tab.
### Relevant log output / Stack trace / Full Error Message.
```shell
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the notification component's Mark all as read click handler and the frappe.desk.doctype.notification_log.notification_log.mark_all_as_read API call. Verify that the response is awaited and that the sidebar unread count and notification items are refreshed or updated. Done means the popover, badge, and reopened notification list all show the read state and a zero count.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100