fix(recording): report failed audio saves and preserve recovery data - #5
Merged
Merged
Conversation
Failed audio finalization was silently reported as success. Now: - stop_recording returns a typed StopRecordingError; recording-stopped carries recovery metadata (recovery_available, audio_file_available). - Checkpoints are preserved until audio + transcripts + metadata all succeed; FFmpeg encode/concat run async, are cancellable, and publish audio.mp4 atomically after non-empty verification. - Accumulation worker is drained (awaited JoinHandle) at stop instead of a fixed sleep, preventing tail-audio loss. - Timed-out transcription worker is aborted+joined before model unload/finalization. - Frontend persists transcripts even when completion is unobserved (transcriptionComplete || hasTranscripts) with an honest warning toast; retains a durable IndexedDB audio-repair record linked to the existing SQLite meeting (no duplicate on recovery). - FFmpeg concat paths escape single quotes so meeting names with apostrophes no longer fail finalize/recovery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Failed audio finalization (FFmpeg / checkpoint / disk errors) was swallowed and reported to the user as a successful save, even when
audio.mp4was never produced.Fix (end to end)
stop_recordingreturns a typedStopRecordingError; therecording-stoppedevent carriesrecovery_available/audio_file_availableso the UI can react accurately (error vs success).kill_on_drop), and publishaudio.mp4atomically after non-empty verification.JoinHandle, drained at stop after the pipeline closes the channel (replaces a fixed 200ms sleep).abort()-ed and joined before model unload / finalization, so it cannot race the save.transcriptionComplete || hasTranscripts) with a distinct warning toast, and retains a durable IndexedDB audio-repair record linked to the existing SQLite meeting (no duplicate on recovery).Karan's Review) no longer fail finalize/recovery.Validation
concat_escape_handles_single_quotesandfailed_finalization_preserves_checkpoints.tsc --noEmitexit 0; editor diagnostics clean.Notes