fix: Consider the emails where in-reply-to header has multiple values (#7715)

- Return the first message id for now to avoid the errors and subsequently missing the message.
- Use .last instead of .first to avoid expensive query.
- Fix array response in response bot.

Fixes:  https://linear.app/chatwoot/issue/CW-2358/activerecordstatementinvalid-pgdatatypemismatch-error-argument-of-and
This commit is contained in:
Pranav Raj S
2023-08-11 17:53:57 -07:00
committed by GitHub
parent 6f09f20991
commit ebefb2e201
5 changed files with 54 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ class Enterprise::MessageTemplates::ResponseBotService
end
def create_messages(response, conversation)
response = process_response_content(response)
response = process_response_content(response).first
create_outgoing_message(response, conversation)
end