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
In certain conditions, android seems to pause the background job and resume it later. If this time gap is larger than the update checking interval, we end up with the same app being downloaded in 2 simultaneous background processes. Both processes write to the same file, overwriting each other and resulting in a corrupt APK (the resulting error usually reads "could not get ID from APK").
This could be fixed by checking whether a file is actively being written to before starting a download. If it is, we assume there is already another download in progress and avoid starting a new one. The simplest way to check is probably just reading the file size, then reading it again 5 seconds later (unless the connection is very slow, an existing download should have progressed a bit over that time).
This would also prevent this issue from happening if a user tries manually updating while a background update is already in progress.
The text was updated successfully, but these errors were encountered:
In certain conditions, android seems to pause the background job and resume it later. If this time gap is larger than the update checking interval, we end up with the same app being downloaded in 2 simultaneous background processes. Both processes write to the same file, overwriting each other and resulting in a corrupt APK (the resulting error usually reads "could not get ID from APK").
This could be fixed by checking whether a file is actively being written to before starting a download. If it is, we assume there is already another download in progress and avoid starting a new one. The simplest way to check is probably just reading the file size, then reading it again 5 seconds later (unless the connection is very slow, an existing download should have progressed a bit over that time).
This would also prevent this issue from happening if a user tries manually updating while a background update is already in progress.
The text was updated successfully, but these errors were encountered: