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

[Bug]: status code is -1 after iOS download task succeeds #1423

Open
1 task done
hgroenenboom opened this issue Aug 28, 2024 · 0 comments
Open
1 task done

[Bug]: status code is -1 after iOS download task succeeds #1423

hgroenenboom opened this issue Aug 28, 2024 · 0 comments

Comments

@hgroenenboom
Copy link

Detailed steps on how to reproduce the bug

Reproduction steps:

  • use juce::URL::downloadToFile to download a zip file on iOS.
  • wait for the DownloadTask isFinished() to return true
  • retreive the status code of the download using statusCode()
  • the status code is -1 even if the download succeeds

Cause:
The didCompleteWithError delegate seems to always be invoked, even if no error occurs. If no error occurs the NSError is null. The JUCE method checks whether error is null and the sets httpCode to -1, while it should either not set it at all or set it to 200.

See apple documentation: https://developer.apple.com/documentation/foundation/nsurlsessiontaskdelegate/1411610-urlsession?language=objc

Relevant code line:

httpCode = nsError != nil ? getHTTPErrorCode (nsError) : -1;

What is the expected behaviour?

I expect a status code of 200 if the download succeeds without errors

Operating systems

iOS

What versions of the operating systems?

Device: iPad Pro 11-inch M4 (Simulator)
OS: iPadOS 17.15 (21F79)

Architectures

Other

Stacktrace

No response

Plug-in formats (if applicable)

Standalone

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct
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

No branches or pull requests

1 participant