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
This commit is contained in:
Toan Le
2024-05-09 10:38:16 +07:00
committed by GitHub
parent 3a1299520c
commit 4eec0aa11a

View File

@@ -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