You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately you are handling the removal of the latch incorrectly by placing this line:
if (bytesCurrent == bytesTotal)
in onProgressChanged. This won't work correctly because sometimes the initial call by the Transfer manager gives the total as 0 out of 0 bytes which in turn means you are removing the latch and returning a file of 0 bytes in size, even though the download has not completed, which in turn causes Picasso to either retry the download or fail, depending on how fast the retry is.
You need to handle the latch countdown in onStateChanged(). This method reports when the download has completed or has been cancelled.
The text was updated successfully, but these errors were encountered:
Hello! Unfortunately I don't have time to work on that project currently, but PRs are always welcome - if you've fixed this issue already, please send me a PR and I'll review it as soon as I can.
Thanks for the help!
Unfortunately you are handling the removal of the latch incorrectly by placing this line:
if (bytesCurrent == bytesTotal)
in onProgressChanged. This won't work correctly because sometimes the initial call by the Transfer manager gives the total as 0 out of 0 bytes which in turn means you are removing the latch and returning a file of 0 bytes in size, even though the download has not completed, which in turn causes Picasso to either retry the download or fail, depending on how fast the retry is.
You need to handle the latch countdown in onStateChanged(). This method reports when the download has completed or has been cancelled.
The text was updated successfully, but these errors were encountered: