Don't call download completion handler twice#58
Don't call download completion handler twice#58jamitJona wants to merge 1 commit intoJamitLabs:developfrom
Conversation
| @@ -356,7 +356,10 @@ extension Client: DownloadExecutorDelegate { | |||
|
|
|||
| public func downloadExecutor(_ downloadTask: URLSessionDownloadTask, didCompleteWithError error: Error?) { | |||
There was a problem hiding this comment.
Maybe we should rename the delegate function to didFailWithError error: Error? What do you think?
There was a problem hiding this comment.
I don't think so. This is basically the same naming as in the URLSessionDownloadDelegate. We just "convert" two delegate methods (didCompleteWithError and didFinishDownloadingTo) into one completion. And therefore we should keep track when it's appropriate to call the completion.
There was a problem hiding this comment.
Hm ok, then we could leave it as is. Can you please add documentation or rethink the visibility of the function? Is it necessary, that it is available from outside of the framework?
|
@jamitJona What's the actual state of this PR? |
|
@jamitJona maybe you can give us an update about this PR? |
Description
Evaluates the error in
Client.downloadExecutor(_ downloadTask: URLSessionDownloadTask, didCompleteWithError error: Error?)to avoid the completion handler call in case the error is nil.Solves #57