From e24e65b40176e4b85e2ebb8cb83e77f67599b7e0 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Wed, 12 Nov 2025 12:16:12 +0100 Subject: [PATCH] Rollback OTA update if launcher fails to start --- CHANGELOG.md | 10 +++++++++- internal_filesystem/main.py | 16 +++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17963936..ee714be1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ +0.3.2 +===== +- Settings app: add "Auto Start App" setting +- Fri3d-2024 Badge: use same SPI freq as Waveshare 2 inch for uniformity +- ESP32: reduce drawing frequency increasing task_handler duration from 1ms to 5ms +- Tweak gesture navigation to trigger back and top menu more easily +- Rollback OTA update if launcher fails to start + 0.3.1 ===== -- OSUpdate app: fix typo that caused update rollback +- OSUpdate app: fix typo that prevented update rollback from being cancelled - Fix 'Home' button in top menu not stopping all apps - Update micropython-nostr library to fix epoch time on ESP32 and NWC event kind diff --git a/internal_filesystem/main.py b/internal_filesystem/main.py index e3d4b376..61126efb 100644 --- a/internal_filesystem/main.py +++ b/internal_filesystem/main.py @@ -74,15 +74,17 @@ except Exception as e: # Start launcher so it's always at bottom of stack launcher_app = PackageManager.get_launcher() -mpos.apps.start_app(launcher_app.fullname) +started_launcher = mpos.apps.start_app(launcher_app.fullname) # Then start another app if configured auto_start_app = prefs.get_string("auto_start_app", None) if auto_start_app and launcher_app.fullname != auto_start_app: mpos.apps.start_app(auto_start_app) -# If we got this far without crashing, then no need to rollback the update: -try: - import ota.rollback - ota.rollback.cancel() -except Exception as e: - print("main.py: warning: could not mark this update as valid:", e) +if not started_launcher: + print("WARNING: launcher {launcher_app} failed to start, not cancelling OTA update rollback") +else: + try: + import ota.rollback + ota.rollback.cancel() + except Exception as e: + print("main.py: warning: could not mark this update as valid:", e)