From 41367739d1e4c08282b0745b5f61e1b213b194ad Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 25 Jul 2024 11:50:05 +0530 Subject: [PATCH] feat: add more logging to notifications listener --- app/listeners/notification_listener.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/listeners/notification_listener.rb b/app/listeners/notification_listener.rb index 666bc4d13..7dadca52d 100644 --- a/app/listeners/notification_listener.rb +++ b/app/listeners/notification_listener.rb @@ -33,12 +33,19 @@ class NotificationListener < BaseListener return if event.data[:notifiable_assignee_change].blank? return if conversation.pending? + Rails.logger.info "[NotificationListener] Assignee changed for conversation: #{conversation.id} to #{assignee&.id} [#{assignee&.email}]" + NotificationBuilder.new( notification_type: 'conversation_assignment', user: assignee, account: account, primary_actor: conversation ).perform + rescue NoMethodError => e + Rails.logger.error "[NotificationListener] Error in assignee_changed: #{e.message}" + exception_tracker = ChatwootExceptionTracker.new(e, account: account, + additional_context: { 'conversation': conversation, 'assignee': assignee }) + exception_tracker.capture_exception end def message_created(event)