Let rows update their counts, drop fake dates, and own failed lookups

MAC6: a snapshot mutation carries its video count back to the list cache.
MAC8: playlist rows and cards are Buttons with the context menu attached,
so macOS accessibility can reach Edit and Delete.
MAC10: a published date stamped with the request's own time is dropped at
both API sentinels, and formattedPublishedDate refuses zero-interval output.
MAC11: a failed history hydration shows Details unavailable with a Try
Again action instead of keeping the raw video ID forever; an empty 200
body is a legible failure.
This commit is contained in:
Arkadiusz Fal
2026-09-11 20:28:35 +02:00
parent 3281840a8e
commit c0d38834a6
9 changed files with 268 additions and 41 deletions

View File

@@ -228,6 +228,16 @@ actor HTTPClient {
) async throws -> T {
let data = try await performRaw(request, customHeaders: customHeaders)
// A body with nothing in it is a failed answer however the status line
// reads: instances do answer `200` with zero bytes, and that is not a
// response any of these types can be decoded from.
guard !data.isEmpty else {
Task { @MainActor in
LoggingService.shared.error("API returned an empty response body", category: .api)
}
throw APIError.decodingError("Empty response body")
}
do {
return try decoder.decode(T.self, from: data)
} catch let error as DecodingError {