Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DownloadHandler.CompletionHandler called twice #57

Open
jamitJona opened this issue Dec 2, 2020 · 0 comments · May be fixed by #58
Open

DownloadHandler.CompletionHandler called twice #57

jamitJona opened this issue Dec 2, 2020 · 0 comments · May be fixed by #58

Comments

@jamitJona
Copy link
Contributor

If a download via the download method in Client succeeds the completion handler is called twice:

The first call is triggered by downloadExecutor(_ downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL). The second by downloadExecutor(_ downloadTask: URLSessionDownloadTask, didCompleteWithError error: Error?) with error = nil.

Since download(url: URL, progressHandler: DownloadHandler.ProgressHandler, _ completion: @escaping DownloadHandler.CompletionHandler) offers a completion handler (and not some delegation), completion should only called once after the internal downloadTask has finished.

@jamitJona jamitJona linked a pull request Dec 2, 2020 that will close this issue
@jamitJona jamitJona linked a pull request Dec 2, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant