mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 18:10:16 +00:00
Work around Apple crash in iOS 27.2 beta. Don’t use <= or >= with Dates.
This commit is contained in:
1 parent
fcbc491180
commit
7214b44dc3
5 files changed
+14
-7
No files matched your search
@@ -250,7 +250,8 @@ struct FeedlyEntryParser {
|
||||
// archive “now.” Publisher dates aren’t always reliable (per Feedly), so a
|
||||
// future-dated article falls back to crawled rather than pinning itself to
|
||||
// the top of a date-sorted timeline.
|
||||
if let published = entry.published, published <= entry.crawled {
|
||||
// Not <=, which is back-deployed and crashes on iOS 27.2 betas.
|
||||
if let published = entry.published, published < entry.crawled {
|
||||
return published
|
||||
}
|
||||
return entry.crawled
|
||||
|
||||
@@ -264,7 +264,8 @@ import Secrets
|
||||
guard let datePublished = $0.datePublished, let since else {
|
||||
return true
|
||||
}
|
||||
return datePublished >= since
|
||||
// Not >=, which is back-deployed and crashes on iOS 27.2 betas.
|
||||
return datePublished > since
|
||||
}
|
||||
let feedIDsAndItems = Dictionary(grouping: parsedItems, by: { item in item.feedURL }).mapValues {
|
||||
Set($0)
|
||||
|
||||
@@ -382,7 +382,8 @@ private extension DownloadedImageCache {
|
||||
guard Self.networkAllowsDownloads, !isWaitingToRetry(url) else {
|
||||
return
|
||||
}
|
||||
guard let validation = await ImageDatabase.shared.fetchDownloadedImageValidation(url: url), validation.nextCheck <= Date() else {
|
||||
// Not <=, which is back-deployed and crashes on iOS 27.2 betas.
|
||||
guard let validation = await ImageDatabase.shared.fetchDownloadedImageValidation(url: url), validation.nextCheck < Date() else {
|
||||
return
|
||||
}
|
||||
guard let imageURL = URL(string: url) else {
|
||||
@@ -592,7 +593,8 @@ extension DownloadedImageCache {
|
||||
var byteCount = recordsCountedTowardLimit.reduce(0) { $0 + $1.byteCount }
|
||||
|
||||
for (record, key, recordByteCount) in recordsCountedTowardLimit where !urlsInUse.contains(record.url) {
|
||||
if byteCount <= maximumByteCount || record.lastAccessed >= recentChangeDate {
|
||||
// Not >=, which is back-deployed and crashes on iOS 27.2 betas.
|
||||
if byteCount <= maximumByteCount || record.lastAccessed > recentChangeDate {
|
||||
break
|
||||
}
|
||||
urls.append(record.url)
|
||||
|
||||
@@ -19,7 +19,8 @@ public struct CacheControlInfo: Codable, Equatable, Sendable {
|
||||
dateCreated + maxAge
|
||||
}
|
||||
public var canResume: Bool {
|
||||
Date() >= resumeDate
|
||||
// Not >=, which is back-deployed and crashes on iOS 27.2 betas.
|
||||
Date() > resumeDate
|
||||
}
|
||||
|
||||
/// canResume with a maximum maxAge. We do this because
|
||||
@@ -28,7 +29,8 @@ public struct CacheControlInfo: Codable, Equatable, Sendable {
|
||||
/// clearly not intentional.
|
||||
public func canResume(maxMaxAge: TimeInterval) -> Bool {
|
||||
let maxAgeToUse = min(maxMaxAge, maxAge)
|
||||
return Date() >= dateCreated + maxAgeToUse
|
||||
// Not >=, which is back-deployed and crashes on iOS 27.2 betas.
|
||||
return Date() > dateCreated + maxAgeToUse
|
||||
}
|
||||
|
||||
public init(dateCreated: Date, maxAge: TimeInterval) {
|
||||
|
||||
@@ -20,7 +20,8 @@ struct HTTPResponse429 {
|
||||
dateCreated + TimeInterval(retryAfter)
|
||||
}
|
||||
var canResume: Bool {
|
||||
Date() >= resumeDate
|
||||
// Not >=, which is back-deployed and crashes on iOS 27.2 betas.
|
||||
Date() > resumeDate
|
||||
}
|
||||
|
||||
init?(url: URL, retryAfter: TimeInterval) {
|
||||
|
||||
Reference in new issue
Block a user