Skip to content

Commit ab6343c

Browse files
p-linnaneclaude
andauthored
fix: make release loading resilient to individual fetch failures (#9)
A missing data file (macOS-26.4-25E5223i.json) caused fetchAllReleases() to fail entirely, showing zero releases in the app. Switch from withThrowingTaskGroup to withTaskGroup so individual failures are logged and skipped instead of aborting the whole load. Also add the missing Tahoe 26.4 beta 3 data file. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 73d5c5f commit ab6343c

2 files changed

Lines changed: 502 additions & 4 deletions

File tree

Sources/macOSdbKit/DataProvider.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,25 @@ public actor DataProvider {
6262
public func fetchAllReleases() async throws -> [Release] {
6363
let index = try await fetchReleaseIndex()
6464

65-
return try await withThrowingTaskGroup(of: Release.self, returning: [Release].self) { group in
65+
return await withTaskGroup(of: Release?.self, returning: [Release].self) { group in
6666
for entry in index {
6767
group.addTask {
68-
try await self.fetchRelease(entry)
68+
do {
69+
return try await self.fetchRelease(entry)
70+
} catch {
71+
Self.logger.error(
72+
"Skipping \(entry.osVersion) (\(entry.buildNumber)): \(error.localizedDescription)"
73+
)
74+
return nil
75+
}
6976
}
7077
}
7178

7279
var releases: [Release] = []
73-
for try await release in group {
74-
releases.append(release)
80+
for await release in group {
81+
if let release {
82+
releases.append(release)
83+
}
7584
}
7685
return releases.sorted()
7786
}

0 commit comments

Comments
 (0)