Displays: a pending change cannot be reverted if the app is hard-killed or crashes #68

Open
opened 2026-10-13 19:37:17 +08:00 by Breadway · 3 comments
Owner

How it was found: while implementing BSET-48 (PR #67). The keep-or-revert deadline now lives in a backend thread inside the bos-settings process, so closing the window, leaving the page and a normal exit all revert. A SIGKILL, crash or power loss while a change is pending leaves the temporary layout live. It is not saved (nothing is persisted before Keep), but nothing restores the previous live layout until the next login.

Confidence: high that the gap exists (it follows from the design); not reproduced live because live hyprctl testing was out of bounds.

Idea: write the pre-change snapshot and deadline to a small file in the runtime dir before applying, and have a tiny watchdog (a detached helper or a systemd user timer) restore it if the app is gone when the deadline passes. At next app start, check for a stale snapshot and offer to restore it.

**How it was found:** while implementing BSET-48 (PR #67). The keep-or-revert deadline now lives in a backend thread inside the bos-settings process, so closing the window, leaving the page and a normal exit all revert. A SIGKILL, crash or power loss while a change is pending leaves the temporary layout live. It is not saved (nothing is persisted before Keep), but nothing restores the previous live layout until the next login. **Confidence:** high that the gap exists (it follows from the design); not reproduced live because live hyprctl testing was out of bounds. **Idea:** write the pre-change snapshot and deadline to a small file in the runtime dir before applying, and have a tiny watchdog (a detached helper or a systemd user timer) restore it if the app is gone when the deadline passes. At next app start, check for a stale snapshot and offer to restore it.
Author
Owner

PR: #84 (head 44d5438)

PR: https://git.breadway.dev/Breadway/bos-settings/pulls/84 (head 44d5438)
Author
Owner

Review of PR 84 at head 44d5438: CHANGES REQUESTED. All required checks pass (fmt, clippy, 190 tests, frontend check/test/build, Forgejo check green). One defect: change ids restart at 1 in every run, so a stale record and its watchdog from a killed run can collide with the first change of a restarted app inside the same window (the original layout is overwritten in the record, and the old watchdog adopts the new record). Needs process-unique ids plus handling an existing foreign record before arming. Details on the PR: #84 (comment)

Review of PR 84 at head 44d5438: CHANGES REQUESTED. All required checks pass (fmt, clippy, 190 tests, frontend check/test/build, Forgejo check green). One defect: change ids restart at 1 in every run, so a stale record and its watchdog from a killed run can collide with the first change of a restarted app inside the same window (the original layout is overwritten in the record, and the old watchdog adopts the new record). Needs process-unique ids plus handling an existing foreign record before arming. Details on the PR: https://git.breadway.dev/Breadway/bos-settings/pulls/84#issuecomment-4918
Author
Owner

PR 84 re-reviewed at head 726ddb9: PASS and merged into main as merge commit c8decceb1f. The id collision across runs is fixed (clock-seeded ids, foreign record settled before arming) and both new regression tests fail without the fix. fmt, clippy, 193 cargo tests, frontend check/test/build and Forgejo check were green on the exact head. Awaiting verification: a live SIGKILL in the BOS VM is still outstanding, so the card stays out of done until the coordinator has run it. Review: #84 (comment)

PR 84 re-reviewed at head 726ddb9: PASS and merged into main as merge commit c8decceb1f763012801b7132e491d5df18af146b. The id collision across runs is fixed (clock-seeded ids, foreign record settled before arming) and both new regression tests fail without the fix. fmt, clippy, 193 cargo tests, frontend check/test/build and Forgejo check were green on the exact head. Awaiting verification: a live SIGKILL in the BOS VM is still outstanding, so the card stays out of done until the coordinator has run it. Review: https://git.breadway.dev/Breadway/bos-settings/pulls/84#issuecomment-4924
Breadway reopened this issue 2026-10-14 19:05:48 +08:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bos-settings#68
No description provided.