More efficient update downloads
mhmd-azeez opened this issue · comments
Problem
Currently, the updater will try to download new updates every time the app starts up, and each time it downloads the files to a different folder in Windows' Temp folder. This might waste the users data if the app is closed before the download is finished. Because next time the app starts up, everything will be downloaded again from scratch.
So the updater must be smart enough that if some of the files have already been downloaded, it must just continue downloading from where it had stopped the previous time and not start again from the beginning.
Solution
If the updater detects a failed update attempt and the attempt was new (it was for the latest version), then it should try to continue the downloading process from where it had been stopped. These rules decide whether the file will be downloaded again, or not:
- If the temp file was already downloaded and was of the same size and version as the remote file (the file on the update server), then it will not be downloaded again.
- If the file was partially downloaded, a new copy will be downloaded from update server.