fix: Update the in_reply_to to logic to use processed_mail (#7793)

This commit is contained in:
Pranav Raj S
2023-08-24 03:49:17 -07:00
committed by GitHub
parent 4cbb3208e8
commit 6ddc99d066
2 changed files with 10 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ class Imap::ImapMailbox
end
def in_reply_to
@inbound_mail.in_reply_to
@processed_mail.in_reply_to
end
def find_message_by_references

View File

@@ -171,5 +171,14 @@ RSpec.describe Imap::ImapMailbox do
expect(references_email.mail.references).to include('test-reference-id-2')
end
end
context 'when a reply for a conversation has multiple in_reply_to' do
let(:multiple_in_reply_to_mail) { create_inbound_email_from_fixture('multiple_in_reply_to.eml').mail }
it 'creates conversation taking the first in_reply_to email' do
class_instance.process(multiple_in_reply_to_mail, channel)
expect(conversation.additional_attributes['in_reply_to']).to eq(multiple_in_reply_to_mail.in_reply_to.first)
end
end
end
end