Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sojan-official committed May 10, 2024
1 parent 5b3d04a commit 7c3151e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/listeners/participation_listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ def assignee_changed(event)
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}"
Expand Down

0 comments on commit 7c3151e

Please sign in to comment.