-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
stopDownload does not cause download promise to reject #72
Comments
Having thought some more on this, maybe the current behaviour is by design? If one does not have any intention of supporting resume, one could then supposedly do something like this:
This works pretty well, but the promise will remain unresolved and unrejected, which feels like a memory leak. Maybe a good compromise is to keep the current behaviour if |
Hi @Alatius , thanks for digging into it! On your first message I though — great, let's adopt the PR from the upstream, an easy win! On your second message, it seems, it deserves some thinking. My gut feeling tells — maybe reject the initial promise on I don't like your idea with different behavior dependent on |
Yeah, it is a fair point that introducing changes in the behaviour risks breaking the implementation for some people, and maybe my suggestion is not the most elegant. I guess that the reverse situation to your scenario is also a possibility: that someone has implemented a resume functionality without making use of But if we want to minimize the risk of introducing breaking changes, I fear that the solution you suggest may equally, or even more, risk breaking current code, wouldn't it? It seems to me that the root of the problem is that a method to actually fully cancel a download is strangely missing: the intention behind So maybe the proper solution is to introduce a new function, |
I mean, I have no problem with a breaking change between major/minor library versions, I was talking about changing the value of |
Aha, yes, I think I understand your point now. But I wouldn't say that it changes I am still not sure what solution is best though: all proposals mentioned (except for the old pull request I linked to in my first message) have their merits I think. To bring it in line with other similar libraries is probably the way to go, instead of reinventing wheels. |
The documentation says about stopDownload that "the promise returned from the aborted downloadFile() call will reject with an error." This works fine on Android, but not on iOS: the download stops, but the promise remains. This seems to be an old issue, and I found this pull request to another fork: itinance#824
I have tried applying it locally to test it, and it seems to solve the problem, as far as I can see.
The text was updated successfully, but these errors were encountered: