From 1e20bbe1a6c6b0bef3da3853007e22ec2c8f5a5c Mon Sep 17 00:00:00 2001 From: Harsh Vardhan Date: Thu, 13 Aug 2026 19:00:29 +0000 Subject: [PATCH] fix(notifications): add ignore_conflicts=True to Notification.bulk_create When a Celery worker crashes after bulk_create but before the broker ACK, the task is re-queued and re-executed. Without ignore_conflicts, the second bulk_create raises an IntegrityError on the unique constraint, resulting in duplicate in-app notifications visible to workspace members. The sibling EmailNotificationLog.bulk_create already uses ignore_conflicts=True, confirming this was an oversight. Fixes makeplane/plane#9600 Signed-off-by: harsh4vardhan --- apps/api/plane/bgtasks/notification_task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/plane/bgtasks/notification_task.py b/apps/api/plane/bgtasks/notification_task.py index bfb72afa364..2b20bdaadde 100644 --- a/apps/api/plane/bgtasks/notification_task.py +++ b/apps/api/plane/bgtasks/notification_task.py @@ -666,7 +666,7 @@ def notifications( removed_mention=removed_mention, ) # Bulk create notifications - Notification.objects.bulk_create(bulk_notifications, batch_size=100) + Notification.objects.bulk_create(bulk_notifications, batch_size=100, ignore_conflicts=True) EmailNotificationLog.objects.bulk_create(bulk_email_logs, batch_size=100, ignore_conflicts=True) return except Exception as e: