Fix notification deduplication to prevent pile-up in navbar (#945)
* Fix notification deduplication to prevent pile-up in navbar (#944) When tasks/projects remained pending for multiple days, duplicate notifications accumulated in the navbar instead of showing only the most recent one. Updated notification services to properly handle existing notifications: - Delete unread notifications before creating new ones - Respect dismissed notifications (don't recreate) - Respect read notifications (don't duplicate) Changes: - Updated dueTaskService, deferredTaskService, and dueProjectService - Added comprehensive unit tests with 8 test cases Fixes #944 * Fix lint errors and add GitHub bug template reminder to docs
This commit is contained in:
parent
1d5de49b48
commit
105a913a8d
5 changed files with 355 additions and 11 deletions
|
|
@ -68,7 +68,19 @@ async function checkDeferredTasks() {
|
|||
);
|
||||
|
||||
if (existingNotification) {
|
||||
continue;
|
||||
// If notification was dismissed, don't create it again
|
||||
if (existingNotification.dismissed_at) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// If notification is unread, delete it before creating the new one
|
||||
// This prevents duplicate notifications from piling up
|
||||
if (!existingNotification.read_at) {
|
||||
await existingNotification.destroy();
|
||||
} else {
|
||||
// If it was already read, skip creating a new one
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const sources = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue