From 00376a91b68abe7a8d2fee0e165993b01468d629 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 15 Oct 2025 10:48:26 -0700 Subject: [PATCH] Add conditionalGetInfoDate to keep track of when conditional GET info is set. --- Modules/Account/Sources/Account/WebFeed.swift | 9 +++++++++ .../Account/Sources/Account/WebFeedMetadata.swift | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Modules/Account/Sources/Account/WebFeed.swift b/Modules/Account/Sources/Account/WebFeed.swift index 7ca28e5f4..c23436285 100644 --- a/Modules/Account/Sources/Account/WebFeed.swift +++ b/Modules/Account/Sources/Account/WebFeed.swift @@ -132,6 +132,15 @@ public final class WebFeed: Feed, Renamable, Hashable { } } + public var conditionalGetInfoDate: Date? { + get { + return metadata.conditionalGetInfoDate + } + set { + metadata.conditionalGetInfoDate = newValue + } + } + public var cacheControlInfo: CacheControlInfo? { get { metadata.cacheControlInfo diff --git a/Modules/Account/Sources/Account/WebFeedMetadata.swift b/Modules/Account/Sources/Account/WebFeedMetadata.swift index 037890548..f4488c653 100644 --- a/Modules/Account/Sources/Account/WebFeedMetadata.swift +++ b/Modules/Account/Sources/Account/WebFeedMetadata.swift @@ -27,6 +27,7 @@ final class WebFeedMetadata: Codable { case isNotifyAboutNewArticles case isArticleExtractorAlwaysOn case conditionalGetInfo + case conditionalGetInfoDate case cacheControlInfo case externalID = "subscriptionID" case folderRelationship @@ -108,10 +109,23 @@ final class WebFeedMetadata: Codable { didSet { if conditionalGetInfo != oldValue { valueDidChange(.conditionalGetInfo) + if conditionalGetInfo == nil { + conditionalGetInfoDate = nil + } else { + conditionalGetInfoDate = Date() + } } } } + var conditionalGetInfoDate: Date? { + didSet { + if conditionalGetInfoDate != oldValue { + valueDidChange(.conditionalGetInfoDate) + } + } + } + var cacheControlInfo: CacheControlInfo? { didSet { if cacheControlInfo != oldValue {