Bug Description
Notification.objects.bulk_create in the
otifications Celery task is missing ignore_conflicts=True. If the task is dispatched twice for the same event (worker restart, Celery retry, duplicate .delay() call upstream), every subscriber receives duplicate in-app notification entries that are permanently visible in their inbox.
The omission stands out because the very next line, EmailNotificationLog.objects.bulk_create, already uses ignore_conflicts=True.
Affected file
�pps/api/plane/bgtasks/notification_task.py, lines 669-670:
`python
Notification.objects.bulk_create(bulk_notifications, batch_size=100)
vs. the line immediately after:
EmailNotificationLog.objects.bulk_create(bulk_email_logs, batch_size=100, ignore_conflicts=True)
`
Failure scenario
- A Celery worker processes the
otifications task and crashes after �ulk_create (before ACK).
- The broker re-queues the task. The second worker runs the same task for the same event.
- Notification.objects.bulk_create succeeds again (no unique constraint to block it).
- Every workspace member who was notified now has two identical entries in their notification feed. These are permanent - there is no deduplication on read.
This also occurs when two Celery Beat instances run (multi-pod deployments) and both schedule the same notification.
Fix
python Notification.objects.bulk_create(bulk_notifications, batch_size=100, ignore_conflicts=True)
A unique constraint on (receiver_id, actor_id, entity_identifier, entity_type) would make the fix robust, but ignore_conflicts=True is the minimal safe change matching the existing email log pattern.
Environment
Plane develop branch (2026-08-13).
Bug Description
Notification.objects.bulk_create in the
otifications Celery task is missing ignore_conflicts=True. If the task is dispatched twice for the same event (worker restart, Celery retry, duplicate .delay() call upstream), every subscriber receives duplicate in-app notification entries that are permanently visible in their inbox.
The omission stands out because the very next line, EmailNotificationLog.objects.bulk_create, already uses ignore_conflicts=True.
Affected file
�pps/api/plane/bgtasks/notification_task.py, lines 669-670:
`python
Notification.objects.bulk_create(bulk_notifications, batch_size=100)
vs. the line immediately after:
EmailNotificationLog.objects.bulk_create(bulk_email_logs, batch_size=100, ignore_conflicts=True)
`
Failure scenario
otifications task and crashes after �ulk_create (before ACK).
This also occurs when two Celery Beat instances run (multi-pod deployments) and both schedule the same notification.
Fix
python Notification.objects.bulk_create(bulk_notifications, batch_size=100, ignore_conflicts=True)A unique constraint on (receiver_id, actor_id, entity_identifier, entity_type) would make the fix robust, but ignore_conflicts=True is the minimal safe change matching the existing email log pattern.
Environment
Plane develop branch (2026-08-13).