From fe0a5e725caa37115780bc9510e275a7a36a82d8 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 16 Sep 2026 23:37:00 +0200 Subject: [PATCH] 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. --- Yattee/Services/SubscriptionFeedCache.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Yattee/Services/SubscriptionFeedCache.swift b/Yattee/Services/SubscriptionFeedCache.swift index eeae542a..d5fbd9d8 100644 --- a/Yattee/Services/SubscriptionFeedCache.swift +++ b/Yattee/Services/SubscriptionFeedCache.swift @@ -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,