From 2cd88eca966f141b3bc6fa88f6dd810fcab1c900 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 15 Oct 2025 13:57:13 -0700 Subject: [PATCH] =?UTF-8?q?Set=20feed.conditionalGetInfo=20only=20if=20it?= =?UTF-8?q?=E2=80=99s=20different.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Account/LocalAccount/LocalAccountRefresher.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift b/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift index c7f750cab..0ab4cda66 100644 --- a/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift +++ b/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift @@ -133,7 +133,10 @@ extension LocalAccountRefresher: DownloadSessionDelegate { // It’s possible that the conditional get info has changed even if the // content hasn’t changed. // https://inessential.com/2024/08/03/netnewswire_and_conditional_get_issues.html - feed.conditionalGetInfo = conditionalGetInfo + if feed.conditionalGetInfo != conditionalGetInfo { + Self.logger.debug("LocalAccountRefresher: setting conditional GET info for \(url.absoluteString) — contentHash hasn’t changed") + feed.conditionalGetInfo = conditionalGetInfo + } return } @@ -146,8 +149,12 @@ extension LocalAccountRefresher: DownloadSessionDelegate { account.update(feed, with: parsedFeed) { result in if case .success(let articleChanges) = result { + Self.logger.debug("LocalAccountRefresher: setting contentHash for \(url.absoluteString)") feed.contentHash = dataHash - feed.conditionalGetInfo = conditionalGetInfo + if feed.conditionalGetInfo != conditionalGetInfo { + Self.logger.debug("LocalAccountRefresher: setting conditional GET info for \(url.absoluteString)") + feed.conditionalGetInfo = conditionalGetInfo + } self.delegate?.localAccountRefresher(self, articleChanges: articleChanges) } }