TachibanaGeneralLaboratories / download-navi

Free and Open Source software download manager
GNU General Public License v3.0
812 stars 86 forks source link

Download failure after resume a task from specific situations #230

Open KrasnayaPloshchad opened 2 years ago

KrasnayaPloshchad commented 2 years ago

I think this is a regression introduced in 1.6 release. If I download an APK package from F-Droid, after a download task paused due to network error or timeout, I restart the task via ▶ button at the COMPLETED list, the download task started, but after the task finished, the package failed to install, and the installer notice the package is unknown type or corrupted.

proninyaroslav commented 2 years ago
  1. What version of Android? 2. After the error appears (before restarting), the file is deleted on the disk? Or maybe its zero-sizes?
Kita2345 commented 2 years ago

Screenshot_20220215-101744~2

KrasnayaPloshchad commented 2 years ago

No. File was neither deleted on the disk nor zero-side.

proninyaroslav commented 2 years ago

Judging by the error, are you trying to move the file after download?

Kita2345 commented 2 years ago

No, the error occurs after the download is complete

proninyaroslav commented 2 years ago

Please double check, maybe the checkbox is checked in the add dialog or in the Storage settings. Otherwise, I'll check for a possible bug.

xibr commented 2 years ago

I think the screenshot provided by @Kita2345 is not related to this issue, as the download path and the path of move after download are the same destination.

Screenshot_20220216-120630_Download Navi

proninyaroslav commented 2 years ago

@xibr The download and move path can't be the same. Therefore you are getting the error

proninyaroslav commented 2 years ago

It might be worth catching this error and not showing it as it doesn't make much sense: you just can't move the file to the same point and it should be ignored. I moved this in a separate issue https://github.com/TachibanaGeneralLaboratories/download-navi/issues/232

xibr commented 2 years ago

@xibr The download and move path can't be the same. Therefore you are getting the error

Exactly, if someone might have checked the checkbox move after the download complete, it will be the same destination.

xibr commented 2 years ago

About this issue I think we should check if the file exists when the resume button is pressed If not exists we must start the download from the beginning.

proninyaroslav commented 2 years ago

There is an option in the storage settings that allows to delete a file after an error occurs. Might be worth using it. It's hard to say why the file is corrupted after redownloading, in theory it should have been downloaded from the beginning.

KrasnayaPloshchad commented 2 years ago
  1. What version of Android?

I used Samsung Galaxy S6+ Edge with Android 7, later I also accessed a Samsung Galaxy F52 5G, which installed Android 11. All of them reproduced.

KrasnayaPloshchad commented 2 years ago

This could be able to reproduce when I try to download packages from APKPure.

proninyaroslav commented 2 years ago

I can't reproduce this. Sequential steps are needed in which you get it.

KrasnayaPloshchad commented 2 years ago

Oh I usually set download destination to a folder that is other than Download folder, maybe this behavior could affect download results.

proninyaroslav commented 2 years ago

I use Android 10. I go to apkpure.com with a Navi browser, choosing a file, choosing a folder through a system file manager and start downloading. Download ends successfully.