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:
@@ -17,7 +17,7 @@ json.meta do
|
||||
end
|
||||
|
||||
json.id conversation.display_id
|
||||
if conversation.messages.where(account_id: conversation.account_id).first.blank?
|
||||
if conversation.messages.where(account_id: conversation.account_id).last.blank?
|
||||
json.messages []
|
||||
else
|
||||
json.messages [
|
||||
|
||||
Reference in New Issue
Block a user