Repository navigation
Description
Summary
When a Record session ends with nothing heard live (the realtime session never got going, or the socket failed before any turn arrived), saveRecording hands the audio file to transcribe(url, kind: .recording). If that async pass fails (offline, a 5xx, a timeout), the .failure branch only sets state = .failed(fileName:message:). The comment there says the recording "stays in its folder rather than costing the user the audio over a network blip", and the file is kept on disk, but nothing in the app points at it:
- no
SavedTranscriptis added, so it is not in the Library under All or Recordings; - the failed page shows only the error text (for example "Could not connect to the server.") and has no Try Again;
- the path is not shown, and no code ever scans
TranscriptStore.recordingsDirectoryagain, so the file is never offered back to the user and never cleaned up.
Once the user dismisses the error, the recording cannot be reached from Blurt. The scenario that triggers this is a network outage, which is the same condition that makes the live session fail first. Someone who records a meeting while offline loses it from the app.
Code:
transcribe(url, kind: .recording) blurt/App/Blurt/Blurt/Wizard/TranscriptsModel.swift
Lines 382 to 385 in 6739585
case .failure(let error): // A failure isn't "no speech": the recording stays in its folder // rather than costing the user the audio over a network blip. state = .failed(fileName: fileName, message: error.localizedDescription)
Repro
The harness below runs the app's real TranscriptsModel sources against AsyncTranscriptionClient pointed at a local server. transcribe(url, kind: .recording) is exactly the call saveRecording makes.
-
Next to a clone of blurt, create
recloss/Package.swift:// swift-tools-version:6.2 import PackageDescription let package = Package( name: "recloss", platforms: [.macOS(.v15)], dependencies: [.package(path: "../blurt")], targets: [.executableTarget( name: "RecLoss", dependencies: [.product(name: "BlurtEngine", package: "blurt"), .product(name: "AssemblyAI", package: "blurt")], swiftSettings: [.defaultIsolation(MainActor.self)])])
-
Copy
TranscriptsModel.swift,TranscriptsModel+Recording.swift,+Files.swift,+Playback.swift,+Meetings.swift,TranscriptFacet.swiftandClipPlayer.swiftfromApp/Blurt/Blurt/Wizard/intorecloss/Sources/RecLoss/, and addmain.swift:import AssemblyAI import BlurtEngine import Foundation let base = URL(string: CommandLine.arguments[1])! let work = URL(filePath: CommandLine.arguments[2]) try FileManager.default.createDirectory(at: work, withIntermediateDirectories: true) let recording = work.appending(path: "Recording 2026-11-20 at 09.00.00.m4a") try Data(repeating: 7, count: 64_000).write(to: recording) let store = TranscriptStore(url: work.appending(path: "transcripts.json")) let model = TranscriptsModel( apiKey: { "test-key" }, transcriber: FileTranscriber( client: AsyncTranscriptionClient(baseURL: base, transport: URLSession.shared, pollInterval: .milliseconds(10)), apiKeyProvider: { "test-key" }), store: store) try await Task.sleep(for: .milliseconds(300)) model.transcribe(recording, kind: .recording) for _ in 0..<100 { try await Task.sleep(for: .milliseconds(100)) if case .failed = model.state { break } } try await Task.sleep(for: .milliseconds(600)) print("state:", model.state) print("history entries:", model.history.count) print("recording still on disk:", FileManager.default.fileExists(atPath: recording.path)) print("saved store entries:", store.load().count)
-
Run it against a server that answers
POST /v2/uploadwith503 {"error":"Service Unavailable"}, and against a closed port to stand in for being offline:swift build .build/debug/RecLoss http://127.0.0.1:18731 /tmp/recloss-503 .build/debug/RecLoss http://127.0.0.1:18799 /tmp/recloss-offline
Expected
The recording stays reachable in Blurt: a Library entry for it (marked as not transcribed yet) or a Try Again on the failure page, so the user can transcribe it once the network is back.
Actual
state: failed(fileName: "Recording 2026-11-20 at 09.00.00.m4a", message: "AssemblyAI error 503: Service Unavailable")
history entries: 0
recording still on disk: true
saved store entries: 0
---
state: failed(fileName: "Recording 2026-11-20 at 09.00.00.m4a", message: "Could not connect to the server.")
history entries: 0
recording still on disk: true
saved store entries: 0
The mock logged one POST /v2/upload with the 64,000-byte file. Nothing else references the file afterwards.
Suggested fix
On .failure for kind == .recording, save an entry that owns the file and carries no text (or a "Not transcribed" state), and give it a Transcribe action that calls transcribe(url, kind: .recording) again. As a lighter option, keep the URL in State.failed and offer Try Again plus Show in Finder on the failure page. The same retry also covers the case where diarize fails after a partial live transcript.
Activity