Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

fix: changing a custom AI service's settings while it is being checked no longer flashes it as unreachable

wquguruf92a2912f8d7
diff --git a/Sources/Cicada/Ling.swift b/Sources/Cicada/Ling.swift
index 762c70e..9b8ceb7 100644
--- a/Sources/Cicada/Ling.swift
+++ b/Sources/Cicada/Ling.swift
@@ -358,6 +358,12 @@ final class LingClient: ObservableObject {
debugLog("ai \(c.provider.id.rawValue): an older check finished late, dropped")
return
}
+ // Cancelled because a setting changed (the next check is on its way): its requests failed
+ // as "unreachable", which would show a service that can't be reached until that check lands.
+ guard !Task.isCancelled else {
+ debugLog("ai \(c.provider.id.rawValue): a cancelled check dropped")
+ return
+ }
if let simulateBalance { r.balance = simulateBalance }
r.at = Date()
aiCheck = r