Skip to content

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

fix(models): preserve removal order for installation receipts

altic-devfb96e5404acc
diff --git a/Sources/Fluid/Services/PrivateAIIntegrationService.swift b/Sources/Fluid/Services/PrivateAIIntegrationService.swift
index 4f03e6c4..2b9dc2c4 100644
--- a/Sources/Fluid/Services/PrivateAIIntegrationService.swift
+++ b/Sources/Fluid/Services/PrivateAIIntegrationService.swift
@@ -159,7 +159,10 @@ actor PrivateAIIntegrationService {
guard !urls.isEmpty else { return [] }
let modelDirectoryURL = self.modelDirectoryURL.resolvingSymlinksInPath().standardizedFileURL
let modelDirectoryPath = modelDirectoryURL.path
- let targetURLs = Array(Set(urls.map { $0.resolvingSymlinksInPath().standardizedFileURL }))
+ // Preserve provider order: model files precede their installation receipt.
+ var seen = Set<URL>()
+ let targetURLs = urls.map { $0.resolvingSymlinksInPath().standardizedFileURL }
+ .filter { seen.insert($0).inserted }
guard targetURLs.allSatisfy({ $0.path.hasPrefix(modelDirectoryPath + "/") }) else {
throw PrivateAIModelRemovalError(message: "A model file is not in FluidVoice's model folder.")
}