Fix the progress indicator bug I had introduced in working on FeedlyOperation. Make sure FeedlyOperation calls downloadProgress.completeTask(), and make sure that all paths lead there.

This commit is contained in:
Brent Simmons 2020-01-19 16:55:39 -08:00
parent ed23d0ec15
commit a2bcdb1cfd
6 changed files with 7 additions and 1 deletions

View File

@ -51,6 +51,7 @@ class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate,
override func didCancel() {
operationQueue.cancelAllOperations()
addCompletionHandler = nil
super.didCancel()
}
func feedlyOperation(_ operation: FeedlyOperation, didFailWith error: Error) {

View File

@ -64,6 +64,7 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl
override func didCancel() {
operationQueue.cancelAllOperations()
addCompletionHandler = nil
super.didCancel()
}
func feedlySearchOperation(_ operation: FeedlySearchOperation, didGet response: FeedlyFeedsSearchResponse) {

View File

@ -73,7 +73,7 @@ class FeedlyDownloadArticlesOperation: FeedlyOperation {
// TODO: fix error on below line: "Expression type '()' is ambiguous without more context"
//os_log(.debug, log: log, "Cancelling %{public}@.", self)
operationQueue.cancelAllOperations()
didFinish()
super.didCancel()
}
}

View File

@ -48,6 +48,7 @@ class FeedlyOperation: MainThreadOperation {
if !isCanceled {
operationDelegate?.operationDidComplete(self)
}
downloadProgress?.completeTask()
}
func didFinish(with error: Error) {
@ -56,5 +57,6 @@ class FeedlyOperation: MainThreadOperation {
}
func didCancel() {
didFinish()
}
}

View File

@ -138,6 +138,7 @@ final class FeedlySyncAllOperation: FeedlyOperation {
os_log(.debug, log: log, "Cancelling sync %{public}@", syncUUID.uuidString)
self.operationQueue.cancelAllOperations()
syncCompletionHandler = nil
super.didCancel()
}
}

View File

@ -52,6 +52,7 @@ final class FeedlySyncStreamContentsOperation: FeedlyOperation, FeedlyOperationD
override func didCancel() {
os_log(.debug, log: log, "Canceling sync stream contents")
operationQueue.cancelAllOperations()
super.didCancel()
}
func enqueueOperations(for continuation: String?) {