From a1107a1b85920cca0fd3099743b9cbbd3d2805eb Mon Sep 17 00:00:00 2001 From: aakashb95 Date: Thu, 15 Jan 2026 19:57:49 +0530 Subject: [PATCH] fix: mark conv open on human message, suppress template message --- app/models/message.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models/message.rb b/app/models/message.rb index 3be04c54f..275b8b4c1 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -310,10 +310,11 @@ class Message < ApplicationRecord def execute_after_create_commit_callbacks # rails issue with order of active record callbacks being executed https://github.com/rails/rails/issues/20911 reopen_conversation + open_conversation_on_human_response set_conversation_activity dispatch_create_events send_reply - execute_message_template_hooks + execute_message_template_hooks unless human_response? || activity? update_contact_activity end @@ -389,6 +390,13 @@ class Message < ApplicationRecord reopen_resolved_conversation if conversation.resolved? end + def open_conversation_on_human_response + return unless human_response? + return unless conversation.pending? + + conversation.open! + end + def reopen_resolved_conversation # mark resolved bot conversation as pending to be reopened by bot processor service if conversation.inbox.active_bot?