Skip to content

Keep failed recordings in Library, retry transcription - #360

Closed
alexkroman wants to merge 2 commits into
mainfrom
claude/compassionate-wright-m1soxn
Closed

alexkroman wants to merge 2 commits into
mainfrom
claude/compassionate-wright-m1soxn

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

What & why

When a recording's async transcription pass fails (network error, timeout, etc.), the audio file is now kept in the Library as an untranscribed entry rather than being deleted or orphaned. This preserves the user's audio and lets them retry transcription later when the network is back.

The changes:

  1. Untranscribed state: Added SavedTranscript.isUntranscribed to identify recordings with no transcript text. These entries keep the audio reachable from the Library.

  2. Failure handling: When transcription fails, a recording is saved as untranscribed (via keepUntranscribed) instead of being lost. The failure state now carries the entry ID so the UI can offer retry and file access.

  3. Retry flow: Added transcribe(_: SavedTranscript) and retryRecording(_:) to retry untranscribed recordings. Opening an untranscribed entry in the Library triggers transcription.

  4. UI updates:

    • Failed transcription page shows the recording is saved and offers "Try Again" and "Show in Finder" buttons
    • Library entries show "Not transcribed" instead of a word count
    • "Open" button becomes "Transcribe" for untranscribed recordings
    • Copy is disabled for untranscribed entries (no text yet)
  5. Refactoring: Moved the full transcribe implementation and helpers (keepUntranscribed, removeEntry) to TranscriptsModel+Files.swift to split concerns and manage file length.

Fixes the scenario where a user loses audio due to a transient network failure during transcription.

How it was tested

  • scripts/check.sh passes (or CI will, if I'm not on a Mac)
  • I read AGENTS.md and this doesn't reintroduce anything deliberately removed
  • Docs updated if behavior changed

Added unit test untranscribed() in HistoryModelTests to verify the isUntranscribed property correctly identifies recordings with empty/whitespace-only text.

When a recording ended with nothing heard live and the async pass then
failed (offline, a 5xx, a timeout), the file stayed on disk but nothing
pointed at it: no Library entry, no retry, so once the error was
dismissed the recording was unreachable from Blurt.

Now the failure saves the recording as an untranscribed entry
(SavedTranscript.isUntranscribed: a recording with no text). The Library
lists it as "Recording · Not transcribed", and opening it (or its
Transcribe action) runs the async pass again, filling in the same entry
and titling it on success. The failure page says the recording is kept
and offers Try Again and Show in Finder. Untranscribed entries are
skipped by the title backfill and have no Copy.

The transcribing section moves to TranscriptsModel+Files.swift to keep
TranscriptsModel.swift under the file-length budget.

Fixes #331

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1UyQGFGh3VornAuvjw
@alexkroman
alexkroman enabled auto-merge November 24, 2026 22:50
- VoiceOver now announces that the recording was saved, not just the
  error, and an untranscribed Library row's hint says it transcribes.
- The error and the saved-in-Library note share one Label, so they
  align under the icon and read as one message.
- Clearer wording: "The recording is saved in your Library. You can
  transcribe it now or later."
- The inline Show in Finder is disabled once the file is gone, as the
  toolbar's is, and has a tooltip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1UyQGFGh3VornAuvjw

Copy link
Copy Markdown
Collaborator Author

ios-build was cancelled on this PR's head (1d02eb8) when it hit its 30-minute timeout-minutes, and gate then fails on it. The cause isn't this PR:

  • This diff doesn't touch App/BlurtiOS. The job had finished all 365 iOS tests (pass), the coverage gate (96.1%) and the probe build. It was cut off during the periphery scan; swiftlint analyze alone took about 10 minutes.
  • On main, ios-build timed out the same way (run 45491989667 at ba954e0), and gate failed there too.

A re-run would hit the same limit. #355 raises the timeout to 45 minutes, so this PR should go green once that lands and CI runs again. check is still running on this head; compile, format-patch and both ios-sanitizers passed.


Generated by Claude Code

@alexkroman

Copy link
Copy Markdown
Collaborator Author

Closing as a duplicate of #363 (both keep a failed recording in the Library for retry). #363 saves the untranscribed entry before the async pass starts, so the recording keeps an entry however the pass ends — including Back mid-pass, where this PR's cancelled task returns before keepUntranscribed runs and leaves the audio orphaned in its folder. #363's check is also green. Worth carrying over from here as a follow-up: the Library's "Transcribe" label for an untranscribed entry and hiding Copy when there is no text.

@alexkroman alexkroman closed this Nov 24, 2026
auto-merge was automatically disabled November 24, 2026 23:53

Pull request was closed

alexkroman pushed a commit that referenced this pull request Nov 24, 2026
…ffer no Copy

Carried over from #360. An untranscribed recording opens by transcribing,
so its action reads Transcribe and its VoiceOver hint says so; it has no
text, so Copy is left out of its menus and Edit › Copy dims (a nil
onCopyCommand) — as it now also does with nothing selected, where it used
to stay enabled and copy nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants