Skip to content

omamobile-shell 0.2.65: a reboot while widgets load is not a crash, with one retry - #217

Closed
W4HO-ham wants to merge 4 commits into
derekross:mainfrom
W4HO-ham:shell-guard-boot-id
Closed

W4HO-ham wants to merge 4 commits into
derekross:mainfrom
W4HO-ham:shell-guard-boot-id

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

The home screen's crash guard writes each user widget into widget-guard.json while it loads, and an entry still there at the next start meant the shell had died with that widget, so the widget was switched off with "This widget crashed the shell, so it's off". A reboot during the home screen's first seconds leaves the same entries behind. On the palmtop, four kernel pushes in a row this morning switched off three widgets whose code was fine (checked with omamobile-widget check, no QML error anywhere in the journal).

The guard file now carries the boot id (/proc/sys/kernel/random/boot_id) it was written in. Entries still loading from another boot are dropped with their own log line ("was loading when the system went down last boot; not a crash"); entries from the same boot are a shell death and are held back exactly as before. The package test checks the three pieces, and the interop plan's crash-guard section (§2.7) records the rule.

Tested: packages/omamobile-shell/test/all passes here. On the palmtop the same change was applied to the installed 0.2.41's Home.qml by hand and the shell restarted: the guard file gained the boot id and the three widgets load again; a hand edit, so the next package upgrade replaces it with this.

@derekross

Copy link
Copy Markdown
Owner

Heads-up: #193 just merged as omamobile-shell 0.2.52, so this will need the next free version when it lands.

@W4HO-ham
W4HO-ham force-pushed the shell-guard-boot-id branch from c4ea91b to ef03da5 Compare November 1, 2026 00:19
@W4HO-ham W4HO-ham changed the title omamobile-shell 0.2.52: a reboot while widgets load is not a crash omamobile-shell 0.2.57: a reboot while widgets load is not a crash Nov 1, 2026
@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto today's main (0.2.56) and moved to 0.2.57, including the interop plan's mention. The change itself is the same. test/all and tools/pr-check pass.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Second commit, same version: a deliberate quit no longer counts either. omarchy-restart-shell stops the shell with quickshell kill, which is a clean quit, and widgets still loading at that moment were marked as having crashed the shell at the next start. On the palmtop tonight, two restarts in a row switched off all four user widgets (widgetStatus: "This widget crashed the shell, so it's off") until a restart that happened to find nothing loading. A clean quit emits the application's aboutToQuit and a crash never does, so the guard now clears its loading list there, before the shell exits. Only a shell that really died leaves entries behind. test/all checks the handler, and the interop plan's §2.7 says so. test/all and tools/pr-check pass.

@derekross

Copy link
Copy Markdown
Owner

Thanks for this. Losing three good widgets to a run of kernel pushes is exactly the false positive the guard shouldn't produce, and the clean-quit handler is a nice find. The code reads well: an old file without a boot id keeps the strict behaviour, and the writes stay atomic.

One design question before it merges. With the boot-id rule, a widget that brings down the whole phone (say a GPU fault that ends in a watchdog reset) is no longer held back: it loads again at every boot, where before the guard caught it after the first reset. If quickshell quits cleanly on the SIGTERM it gets when the session is torn down for a reboot, your aboutToQuit handler already covers ordinary reboots and shutdowns, and the boot-id rule only adds the unclean resets. Could you check that? And either way, could an entry from another boot get one retry rather than a free pass, for example kept under a suspect key and held back if the same widget is still loading when the next boot starts? That keeps your palmtop's pushes harmless and still stops a loop.

Main is at omamobile-shell 0.2.62 (0.2.63 is about to be taken by voice), so I'll set the next free version myself at merge, including the mention in the interop plan.

W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Nov 1, 2026
…ts one retry, and the quit hook that runs

Review of derekross#217. A widget still loading from another boot now loads once more as a suspect and is held back if it is still loading at the next start, so a widget that takes the whole system down is still stopped after its second reset. Quickshell 0.3 never delivers Qt.application's aboutToQuit to QML and dies on SIGTERM without tearing down, so the deliberate-quit hook is Home's Component.onDestruction, which quickshell kill runs. test/widget-guard runs the real guard block in Quickshell across starts and boots.
@W4HO-ham
W4HO-ham force-pushed the shell-guard-boot-id branch from e7b5843 to 67d9280 Compare November 1, 2026 09:28
@W4HO-ham W4HO-ham changed the title omamobile-shell 0.2.57: a reboot while widgets load is not a crash omamobile-shell 0.2.64: a reboot while widgets load is not a crash, with one retry Nov 1, 2026
@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

I checked, and quickshell doesn't quit cleanly on SIGTERM. Worse, my aboutToQuit handler never ran at all. On Quickshell 0.3.2 (Omarchy's build), I ran a bare config whose Qt.application.onAboutToQuit and Component.onDestruction each write a file, with blockWrites:

how it ends aboutToQuit onDestruction
SIGTERM, SIGHUP, SIGINT no no (it dies on the signal)
quickshell kill no yes ("Exiting due to IPC request")

So the session teardown at a reboot is unclean, and the boot-id rule really is what covers ordinary reboots. The quit hook is now Home's Component.onDestruction, which quickshell kill (so omarchy-restart-shell) does run. Omarchy's notification service flushes its store the same way.

I took the suspect idea. An entry from another boot loads once more and goes under suspect with its hash. If it is still loading when the next start finds it, after a second unclean end in a row, it is held back as a crash. A clean 3 s run clears it, and new files (a new hash) start over. A same-boot death and an old file without a boot id keep the strict rule.

There's a new test/widget-guard that runs the real guard block cut out of Home.qml in Quickshell (offscreen, a scratch config dir, start by start, with the boot id faked between starts). It covers all seven cases, including quickshell kill. Against main's Home.qml, all seven fail. test/all skips it without quickshell. Rebased on main; the version file says 0.2.64, but set whatever is free at merge. I'll run it on the palmtop once it's back up and post the result here.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

test/widget-guard on the palmtop, run as the session user against the palmtop's own Quickshell (0.3.2, AUR quickshell-git 4f508be): all seven cases pass, quickshell kill clearing the loading list included. The first run there crashed Quickshell at start, because an SSH login has no XDG_RUNTIME_DIR. The test now makes a runtime directory of its own when there isn't one; that's the one new commit.

W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Nov 1, 2026
…ts one retry, and the quit hook that runs

Review of derekross#217. A widget still loading from another boot now loads once more as a suspect and is held back if it is still loading at the next start, so a widget that takes the whole system down is still stopped after its second reset. Quickshell 0.3 never delivers Qt.application's aboutToQuit to QML and dies on SIGTERM without tearing down, so the deliberate-quit hook is Home's Component.onDestruction, which quickshell kill runs. test/widget-guard runs the real guard block in Quickshell across starts and boots.
@W4HO-ham
W4HO-ham force-pushed the shell-guard-boot-id branch from 61abffd to 992bc9b Compare November 1, 2026 15:22
@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a careful answer to my question. The table showing that Quickshell dies on SIGTERM without aboutToQuit or onDestruction, and only quickshell kill tears the tree down, changes the picture. The boot-id rule really is what covers ordinary reboots, and moving the quit hook to Component.onDestruction is the right fix. The suspect rule reads well too:

  • an entry from another boot loads once more, as a suspect, keyed by its hash;
  • a second unclean end with the same hash holds it back;
  • a clean 3 s run or new files start it over;
  • a same-boot death and an old file without a boot id keep the strict rule.

test/widget-guard running the real guard block cut out of Home.qml, start by start, is much better than the grep checks alone. It's good to know all seven cases fail against main's Home.qml, and pass on your palmtop's Quickshell.

Nothing more is needed from you. On my side before I merge:

  • Version. Main is at 0.2.62, and two open PRs both claim 0.2.63 (my voice PR and omamobile-shell 0.2.63: the Pixel 8 Pro's panel in the board table #251). I'll give this the next free number at merge, and the same number in the title and in the interop plan's "(omamobile-shell 0.2.64)".
  • Commit message. The squash would carry all four commit messages, including the first ones that describe the 0.2.57 version and the aboutToQuit hook that never ran. I'll write the merged message by hand from the description of what the head does.
  • The 7 Pro. I'll install the head on my phone and restart the shell a couple of times with a user widget on the home screen, since the shell is shared and this changes what the guard writes for every phone.

The crash guard records each user widget in widget-guard.json while it loads, and an entry still there at the next start marked the widget as having crashed the shell. A reboot, a shutdown or a dead battery during the first seconds of the home screen left those entries behind too, so after a few kernel pushes on the Pixel 9a three widgets were switched off with "This widget crashed the shell" although their code was fine.

The guard file now carries the boot id it was written in. At start, entries still loading from another boot are dropped with their own log line; entries from the same boot are still a shell death and are held back as before. The package test checks the three pieces, and the interop plan's crash-guard section says so.
…oading list

omarchy-restart-shell stops the shell with quickshell kill, a clean quit, and widgets still loading at that moment were marked as having crashed the shell at the next start: on the Pixel 9a, two restarts in a row switched off all four user widgets. A clean quit emits aboutToQuit and a crash never does, so the guard now clears what was loading on its way out.
…ts one retry, and the quit hook that runs

Review of derekross#217. A widget still loading from another boot now loads once more as a suspect and is held back if it is still loading at the next start, so a widget that takes the whole system down is still stopped after its second reset. Quickshell 0.3 never delivers Qt.application's aboutToQuit to QML and dies on SIGTERM without tearing down, so the deliberate-quit hook is Home's Component.onDestruction, which quickshell kill runs. test/widget-guard runs the real guard block in Quickshell across starts and boots.
…y when there is none

Over an SSH login on the palmtop there was no XDG_RUNTIME_DIR, and Quickshell crashed at start because it could not create its instance directory.
@W4HO-ham
W4HO-ham force-pushed the shell-guard-boot-id branch from 992bc9b to ad914f3 Compare November 1, 2026 16:26
@W4HO-ham W4HO-ham changed the title omamobile-shell 0.2.64: a reboot while widgets load is not a crash, with one retry omamobile-shell 0.2.65: a reboot while widgets load is not a crash, with one retry Nov 1, 2026
@derekross derekross closed this in 7ea8ab5 Nov 1, 2026
@derekross

Copy link
Copy Markdown
Owner

Merged as 7ea8ab5, renumbered to omamobile-shell 0.2.66 (0.2.63-0.2.65 went to the voice and keyboard releases and the 8 Pro's panel row). On my Pixel 7 Pro: a reboot and three shell restarts, one shell each time, home widgets back, and widget-guard.json kept no crashed or suspect entries. Thanks for chasing this down.

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…ith one retry for a suspect (derekross#217)

A reboot while home widgets load is no longer taken for a widget crash: the guard file carries the boot id it was written in, a widget left loading in an earlier boot counts once as a suspect and is retried, and only a second failure keeps it off, so a widget that crashes the shell at every boot still gets caught. test/widget-guard runs the real guard block from Home.qml (W4HO-ham). Renumbered to 0.2.66 at merge. Checked on the Pixel 7 Pro on 2026-11-01: a reboot and three shell restarts, one shell each time, and the guard file kept no crashed or suspect widgets.

Closes derekross#217

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants