The package downloader deleted the installed language pack as soon as a
version difference with the server was detected, before the download had
even started. If the download then failed (connection drop, server
error), the device was left with an empty language directory: on the
next offline launch, the directory check failed and the app was unusable
until internet access was restored.
The early cleanup was also redundant: _copy_data() already removes the
existing directory right before extracting the new archive, i.e. after
the download has succeeded (HTTP 200).
Changes in package_downloader.gd:
- Remove the pre-download cleanup of the current language directory; the
previous pack now stays usable for offline play until the new one has
been fully downloaded.
- Check the return value of HTTPRequest.request() and show the download
error popup when the request cannot be started, instead of leaving the
screen waiting forever on a request that was never sent.
- Surface extraction failures (missing archive, unzip error) through the
error popup instead of silently returning from the extraction thread
and leaving the user stuck on a frozen progress screen.
Changes in login.gd:
- Handle the result of UserDataManager.login_student(), which was
previously logged and ignored. The synchronization performed right
before the login can delete or move the student locally (e.g. the
server requested a local deletion), in which case the child was sent
to the gardens scene with no student session loaded, ending up on a
dead screen. On failure, play the wrong-password feedback and reset
the code keyboard instead of changing scene.
Verified with the GUT test suite (58/58 passing).