chore: Ignore notification when assignee is nil (#11105)

The issue was that when a team change results in an assignee being set
to nil, the system was still trying to create a notification about the
assignment change, but there was no assignee to notify, causing
potential issues in the notification system.
This commit is contained in:
Sojan Jose
2025-03-18 20:14:19 -07:00
committed by GitHub
parent 8066b36ebf
commit e2e4da8b1e
2 changed files with 30 additions and 0 deletions

View File

@@ -30,6 +30,12 @@ class NotificationListener < BaseListener
def assignee_changed(event)
conversation, account = extract_conversation_and_account(event)
assignee = conversation.assignee
# NOTE: The issue was that when a team change results in an assignee being set to nil,
# the system was still trying to create a notification about the assignment change,
# but there was no assignee to notify, causing potential issues in the notification system.
# We need to debug this properly, but for now no need to pollute the jobs
return if assignee.blank?
return if event.data[:notifiable_assignee_change].blank?
return if conversation.pending?