Skip to content

Commit e24e65b

Browse files
Rollback OTA update if launcher fails to start
1 parent 9ba9504 commit e24e65b

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
0.3.2
2+
=====
3+
- Settings app: add "Auto Start App" setting
4+
- Fri3d-2024 Badge: use same SPI freq as Waveshare 2 inch for uniformity
5+
- ESP32: reduce drawing frequency increasing task_handler duration from 1ms to 5ms
6+
- Tweak gesture navigation to trigger back and top menu more easily
7+
- Rollback OTA update if launcher fails to start
8+
19
0.3.1
210
=====
3-
- OSUpdate app: fix typo that caused update rollback
11+
- OSUpdate app: fix typo that prevented update rollback from being cancelled
412
- Fix 'Home' button in top menu not stopping all apps
513
- Update micropython-nostr library to fix epoch time on ESP32 and NWC event kind
614

internal_filesystem/main.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,17 @@ def custom_exception_handler(e):
7474

7575
# Start launcher so it's always at bottom of stack
7676
launcher_app = PackageManager.get_launcher()
77-
mpos.apps.start_app(launcher_app.fullname)
77+
started_launcher = mpos.apps.start_app(launcher_app.fullname)
7878
# Then start another app if configured
7979
auto_start_app = prefs.get_string("auto_start_app", None)
8080
if auto_start_app and launcher_app.fullname != auto_start_app:
8181
mpos.apps.start_app(auto_start_app)
8282

83-
# If we got this far without crashing, then no need to rollback the update:
84-
try:
85-
import ota.rollback
86-
ota.rollback.cancel()
87-
except Exception as e:
88-
print("main.py: warning: could not mark this update as valid:", e)
83+
if not started_launcher:
84+
print("WARNING: launcher {launcher_app} failed to start, not cancelling OTA update rollback")
85+
else:
86+
try:
87+
import ota.rollback
88+
ota.rollback.cancel()
89+
except Exception as e:
90+
print("main.py: warning: could not mark this update as valid:", e)

0 commit comments

Comments
 (0)