mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user