From efda39dda3b8d7c2d864ba4b778a54f2737b0731 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 30 Apr 2020 15:55:02 -0500 Subject: [PATCH] Log the end of sending the statuses if we don't send any. --- .../CloudKit/CloudKitAccountDelegate.swift | 1 + Frameworks/Articles/Article.swift | 59 ++++++++++++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift index 3879672d0..1b506a19c 100644 --- a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift +++ b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift @@ -103,6 +103,7 @@ final class CloudKitAccountDelegate: AccountDelegate { func processStatuses(_ syncStatuses: [SyncStatus]) { guard syncStatuses.count > 0 else { + os_log(.debug, log: self.log, "Done sending article statuses.") completion(.success(())) return } diff --git a/Frameworks/Articles/Article.swift b/Frameworks/Articles/Article.swift index 855df90bd..d21356739 100644 --- a/Frameworks/Articles/Article.swift +++ b/Frameworks/Articles/Article.swift @@ -65,7 +65,64 @@ public struct Article: Hashable { // MARK: - Equatable static public func ==(lhs: Article, rhs: Article) -> Bool { - return lhs.articleID == rhs.articleID && lhs.accountID == rhs.accountID && lhs.webFeedID == rhs.webFeedID && lhs.uniqueID == rhs.uniqueID && lhs.title == rhs.title && lhs.contentHTML == rhs.contentHTML && lhs.contentText == rhs.contentText && lhs.url == rhs.url && lhs.externalURL == rhs.externalURL && lhs.summary == rhs.summary && lhs.imageURL == rhs.imageURL && lhs.datePublished == rhs.datePublished && lhs.dateModified == rhs.dateModified && lhs.authors == rhs.authors + guard lhs.articleID == rhs.articleID else { + print("*********** miss matched articleID") + return false + } + guard lhs.accountID == rhs.accountID else { + print("*********** miss matched accountID") + return false + } + guard lhs.webFeedID == rhs.webFeedID else { + print("*********** miss matched webFeedID") + return false + } + guard lhs.uniqueID == rhs.uniqueID else { + print("*********** miss matched uniqueID") + return false + } + guard lhs.title == rhs.title else { + print("*********** miss matched title") + return false + } + guard lhs.contentHTML == rhs.contentHTML else { + print("*********** miss matched contentHTML") + return false + } + guard lhs.contentText == rhs.contentText else { + print("*********** miss matched contentText") + return false + } + guard lhs.url == rhs.url else { + print("*********** miss matched url") + return false + } + guard lhs.externalURL == rhs.externalURL else { + print("*********** miss matched externalURL") + return false + } + guard lhs.summary == rhs.summary else { + print("*********** miss matched summary") + return false + } + guard lhs.imageURL == rhs.imageURL else { + print("*********** miss matched imageURL") + return false + } + guard lhs.datePublished == rhs.datePublished else { + print("*********** miss matched datePublished") + return false + } + guard lhs.dateModified == rhs.dateModified else { + print("*********** miss matched dateModified") + return false + } + guard lhs.authors == rhs.authors else { + print("*********** miss matched authors") + return false + } + return true +// return lhs.articleID == rhs.articleID && lhs.accountID == rhs.accountID && lhs.webFeedID == rhs.webFeedID && lhs.uniqueID == rhs.uniqueID && lhs.title == rhs.title && lhs.contentHTML == rhs.contentHTML && lhs.contentText == rhs.contentText && lhs.url == rhs.url && lhs.externalURL == rhs.externalURL && lhs.summary == rhs.summary && lhs.imageURL == rhs.imageURL && lhs.datePublished == rhs.datePublished && lhs.dateModified == rhs.dateModified && lhs.authors == rhs.authors } }