From fd4fd5174ee9377d6a5b44018eea206c1af8aee8 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 6 Jul 2021 16:52:31 -0500 Subject: [PATCH] Continue processing if we don't find any articles. Fixes #3213 --- .../CloudKit/CloudKitSendStatusOperation.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift b/Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift index 30c983ef2..1979880a4 100644 --- a/Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift +++ b/Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift @@ -74,11 +74,13 @@ private extension CloudKitSendStatusOperation { case .success(let syncStatuses): func stopProcessing() { - if self.showProgress { - self.refreshProgress?.completeTask() + self.database.resetAllSelectedForProcessing { _ in + if self.showProgress { + self.refreshProgress?.completeTask() + } + os_log(.debug, log: self.log, "Done sending article statuses.") + self.operationDelegate?.operationDidComplete(self) } - os_log(.debug, log: self.log, "Done sending article statuses.") - self.operationDelegate?.operationDidComplete(self) } guard syncStatuses.count > 0 else { @@ -130,10 +132,10 @@ private extension CloudKitSendStatusOperation { } // If this happens, we have somehow gotten into a state where we have new status records - // but the articles didn't come back in the fetch. Rather than crashing, we stop processing + // but the articles didn't come back in the fetch. Rather than crashing, we continue processing // and hope that it gets cleared up later. guard !statusUpdates.isEmpty else { - done(true) + done(false) return }