You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(platform): sending while dictating drops the words not yet transcribed #5034
When someone dictates a prompt and presses Send (or Enter) while still dictating, only the part that was already transcribed is sent. The rest of what they said is lost. A pilot reported this as "dictated prompts are cut off: only the part already transcribed is sent, not everything said before sending".
Why
Observed at maina71d0d92e9.
submit() stops the microphone and sends the field's current text in the same tick (services/platform/app/features/chat/components/composer.tsx:370, :379):
Both dictation paths deliver text after stop(). Web Speech finalizes its interim results in onresult / onend (app/features/chat/hooks/use-speech-to-text.ts). The recorder fallback transcribes on the server in a post-stop round-trip (app/features/chat/components/dictation-button.tsx:62). Whatever arrives after stop() misses the sent message and can land in the field that was just emptied.
Expected
Sending while dictating does the following:
It stops the microphone.
It waits for the final transcript, showing a brief "Finishing transcription…" state and giving up after a timeout.
It appends that transcript and sends the whole text.
If the final transcription fails, nothing is sent. The field keeps what was transcribed, and an error says what happened.
Done when
Unit tests for both paths: text that arrives after stop() is part of the sent message, and a failed post-stop transcription never silently sends a truncated message.
Manual check in Chrome (Web Speech) and in Firefox or Safari (recorder fallback).
Scope for parallel work
This touches the composer's submit path, dictation-button.tsx and use-speech-to-text.ts. The composer height issue from the same pilot touches the composer's sizing only.
Activity
fix(platform): wait for dictation's last words before sending
fix(platform): wait for dictation's last words before sending