From 4eec0aa11a3bef2ad27f57a0e6a977644d1a07ad Mon Sep 17 00:00:00 2001 From: Toan Le Date: Thu, 9 May 2024 10:38:16 +0700 Subject: [PATCH] fix: Profile pictures missing in facebook inbox [CW-1976] (#9212) The ActiveJob FacebookEventsJob created a Contact and then enqueued Avatar::AvatarFromUrlJob in another process. However, since the Contact was created within a transaction when AvatarFromUrlJob was executed immediately afterwards, the Contact was not actually present in the database then. Fixes: #6138 #6761 --- app/builders/contact_inbox_with_contact_builder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/builders/contact_inbox_with_contact_builder.rb b/app/builders/contact_inbox_with_contact_builder.rb index 6e913eda8..2f30093db 100644 --- a/app/builders/contact_inbox_with_contact_builder.rb +++ b/app/builders/contact_inbox_with_contact_builder.rb @@ -19,9 +19,9 @@ class ContactInboxWithContactBuilder ActiveRecord::Base.transaction(requires_new: true) do build_contact_with_contact_inbox - update_contact_avatar(@contact) unless @contact.avatar.attached? - @contact_inbox end + update_contact_avatar(@contact) unless @contact.avatar.attached? + @contact_inbox end private