Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

throw error if downloaded file doesn't exist before installing

Description

Fix the issue where the installation status gets stuck on “Installing”.

Screenshots

N/A

Technical details

The issue is caused by a race condition during APK downloads. When a download starts, the $APK_DOWNLOAD_DIR is cleaned and the APK file is downloaded into that same directory.

If multiple downloads start at the same time, one download may finish and proceed to installation while another download triggers a cleanup of the directory. The directory may also be cleaned for other reasons, such as system cleanup operations.

In these cases, the APK file required for installation can be deleted before the installation begins. The current flow does not handle a missing file scenario and silently keeps the installation status in the “Installing” state.

Adding explicit handling for the case where the APK file does not exist, aborting the installation and preventing the status from getting stuck.

Tests

N/A

Issues

https://gitlab.e.foundation/e/os/backlog/-/issues/3885

10 commandments of code review

👪 ❤️ code review guidelines

Edited by dev-12

Merge request reports

Loading