Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more
Retry an empty meeting in the latest requested language. Fixes #1033
ParamKataria1ad6dd913481
diff --git a/Sources/Fluid/Services/Meeting/MeetingProcessingConfiguration.swift b/Sources/Fluid/Services/Meeting/MeetingProcessingConfiguration.swiftindex 2fae3bcc..332a5e6b 100644--- a/Sources/Fluid/Services/Meeting/MeetingProcessingConfiguration.swift+++ b/Sources/Fluid/Services/Meeting/MeetingProcessingConfiguration.swift@@ -96,11 +96,11 @@ enum MeetingRetranscriptionLanguage {return code != currentLanguageCode}- /// The language a failed empty transcript should try again. The session language stays the one- /// that labels the stored result, so the requested language lives only on the failed attempt.+ /// The language an empty meeting should try again. Only the latest attempt counts: an older+ /// Dutch failure must not replace a later German request that is still pending.static func failedAttemptLanguage(for session: MeetingSession) -> String? {guard session.transcriptSegments.isEmpty,- let language = session.processingAttempts.last(where: { $0.errorCode != nil })?.languageCode,+ let language = session.processingAttempts.last?.languageCode,Self.canRetranscribe(selection: language, currentLanguageCode: session.languageCode)else { return nil }return Self.canonicalCode(language)diff --git a/Tests/FluidDictationIntegrationTests/MeetingRecoveryTests.swift b/Tests/FluidDictationIntegrationTests/MeetingRecoveryTests.swiftindex 8e078d77..29a3ea82 100644--- a/Tests/FluidDictationIntegrationTests/MeetingRecoveryTests.swift+++ b/Tests/FluidDictationIntegrationTests/MeetingRecoveryTests.swift@@ -2645,6 +2645,42 @@ final class MeetingRecoveryTests: XCTestCase {XCTAssertEqual(MeetingRetranscriptionLanguage.failedAttemptLanguage(for: persisted), "nl")}+ func testFailedAttemptLanguageUsesLatestAttemptNotAnOlderError() {+ var session = self.makeSession(state: .completed, endedAt: Date())+ session.languageCode = "en"+ session.transcriptSegments = []+ let started = Date(timeIntervalSinceNow: -60)+ session.processingAttempts = [+ MeetingProcessingAttempt(+ id: UUID(),+ startedAt: started,+ completedAt: started.addingTimeInterval(5),+ stage: .completed,+ pipelineVersion: 1,+ asrProvider: nil,+ asrModel: nil,+ languageCode: "nl",+ diarizationModel: nil,+ lastCompletedTrackID: nil,+ errorCode: "failed"+ ),+ MeetingProcessingAttempt(+ id: UUID(),+ startedAt: Date(),+ completedAt: nil,+ stage: .pending,+ pipelineVersion: 1,+ asrProvider: nil,+ asrModel: nil,+ languageCode: "de",+ diarizationModel: nil,+ lastCompletedTrackID: nil,+ errorCode: nil+ ),+ ]+ XCTAssertEqual(MeetingRetranscriptionLanguage.failedAttemptLanguage(for: session), "de")+ }+func testFailedLanguageChangeWithoutAttemptMetadataKeepsOriginalLanguage() async throws {let dir = self.makeTempDirectory()defer { try? FileManager.default.removeItem(at: dir) }