Merge branch 'develop' into feat/linear-backend
This commit is contained in:
@@ -3,6 +3,13 @@ class ParticipationListener < BaseListener
|
||||
|
||||
def assignee_changed(event)
|
||||
conversation, _account = extract_conversation_and_account(event)
|
||||
conversation.conversation_participants.find_or_create_by!(user_id: conversation.assignee_id) if conversation.assignee_id.present?
|
||||
return if conversation.assignee_id.blank?
|
||||
|
||||
conversation.conversation_participants.find_or_create_by!(user_id: conversation.assignee_id)
|
||||
# We have observed race conditions triggering these errors
|
||||
# example: Assignment happening via automation, while auto assignment is also configured.
|
||||
rescue ActiveRecord::RecordNotUnique, ActiveRecord::RecordInvalid
|
||||
Rails.logger.warn "Failed to create conversation participant for account #{conversation.account.id} " \
|
||||
": user #{conversation.assignee_id} : conversation #{conversation.id}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@ module AssignmentHandler
|
||||
ASSIGNEE_CHANGED => -> { saved_change_to_assignee_id? },
|
||||
TEAM_CHANGED => -> { saved_change_to_team_id? }
|
||||
}.each do |event, condition|
|
||||
condition.call && dispatcher_dispatch(event)
|
||||
condition.call && dispatcher_dispatch(event, previous_changes)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user