Fence stale-generation writes in Yattee Server feed error and progress paths

A stateless-server feed request that failed after an account switch could
write the previous account's error state over the new account's feed, and
a stale poller could flash the old context's partiallyLoaded counts. Guard
both writes on the captured generation, matching the existing completion
fence.
This commit is contained in:
Arkadiusz Fal
2026-09-16 23:37:00 +02:00
parent 8677ac39d3
commit fe0a5e725c

View File

@@ -725,6 +725,7 @@ final class SubscriptionFeedCache {
"Yattee Server feed failed: \(error.localizedDescription)",
category: .general
)
guard generation == accountGeneration else { return }
feedLoadState = .error(.networkError(error.localizedDescription))
isLoading = false
}
@@ -802,6 +803,7 @@ final class SubscriptionFeedCache {
}
// Update progress UI
guard generation == accountGeneration else { return }
feedLoadState = .partiallyLoaded(
readyCount: status.readyCount,
pendingCount: status.pendingCount,