From 3210860841ade23ffa221efa42edcd9841b9f951 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Wed, 6 May 2026 15:23:50 +0700 Subject: [PATCH] fix(messenger): re-broadcast audio message after blob attaches Messenger ingest saves the Attachment row before attaching the blob, so the after_create_commit broadcast bails on file.attached? and the FE never gets the audio bubble until a refresh (or until Whisper finishes, or never if transcription is disabled or returns blank). Re-fire the message update after attach completes. --- app/builders/messages/messenger/message_builder.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/builders/messages/messenger/message_builder.rb b/app/builders/messages/messenger/message_builder.rb index be1f98b43..ecd6f06ea 100644 --- a/app/builders/messages/messenger/message_builder.rb +++ b/app/builders/messages/messenger/message_builder.rb @@ -28,6 +28,10 @@ class Messages::Messenger::MessageBuilder filename: attachment_file.original_filename, content_type: attachment_file.content_type ) + # The Attachment row is saved before the blob is attached, so the + # after_create_commit broadcast bails on `file.attached?`. Re-fire here + # for audio so the bubble updates without waiting on transcription. + attachment.message&.reload&.send_update_event if attachment.file_type.to_sym == :audio end def attachment_params(attachment)