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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user