From 0ba2969eae5027f8a8e79ef8980a6772ba86a059 Mon Sep 17 00:00:00 2001 From: tejaswini chile Date: Wed, 12 Oct 2022 16:47:53 +0530 Subject: [PATCH] fix: duplicate activity messages --- app/models/conversation.rb | 3 +-- app/services/macros/execution_service.rb | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/conversation.rb b/app/models/conversation.rb index 8b490fb9e..29eab8433 100644 --- a/app/models/conversation.rb +++ b/app/models/conversation.rb @@ -195,7 +195,6 @@ class Conversation < ApplicationRecord private def execute_after_update_commit_callbacks - binding.pry notify_status_change create_activity notify_conversation_updation @@ -260,7 +259,7 @@ class Conversation < ApplicationRecord def create_label_change(user_name) return unless user_name - previous_labels, current_labels = reload.previous_changes[:label_list] + previous_labels, current_labels = previous_changes[:label_list] return unless (previous_labels.is_a? Array) && (current_labels.is_a? Array) create_label_added(user_name, current_labels - previous_labels) diff --git a/app/services/macros/execution_service.rb b/app/services/macros/execution_service.rb index 1ceff53ba..befeeea7e 100644 --- a/app/services/macros/execution_service.rb +++ b/app/services/macros/execution_service.rb @@ -25,7 +25,7 @@ class Macros::ExecutionService < ActionService return if conversation_a_tweet? params = { content: message[0], private: false } - mb = Messages::MessageBuilder.new(nil, @conversation, params) + mb = Messages::MessageBuilder.new(nil, @conversation.reload, params) mb.perform end @@ -39,7 +39,7 @@ class Macros::ExecutionService < ActionService return if blobs.blank? params = { content: nil, private: false, attachments: blobs } - mb = Messages::MessageBuilder.new(nil, @conversation, params) + mb = Messages::MessageBuilder.new(nil, @conversation.reload, params) mb.perform end end