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:
@@ -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?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user