Repository navigation
Recover a secure lock whose surface never presented a frame - #18037
DanielJBurbridge wants to merge 1 commit into
Conversation
An EGL allocation failure can leave the session locked with nothing painted. Qt still emits frameSwapped when eglSwapBuffers fails, so restart kept that client and Hyprland would not clear it. Treat that lock as recoverable, and keep a lock that actually presented. Co-authored-by: Daniel Burbridge <DanielJBurbridge@users.noreply.github.com>
[Medium impact] The change affects the desktop lock and shell-restart workflow. Fix the journal decisions and satisfy the test requirements before merging. Findings
SummaryAdds frame tracking and a journal check to identify secure locks that never showed a prompt.
|
| lockPaintJournalQuery += 1 | ||
| lockPaintJournal.generation = generation | ||
| lockPaintJournal.query = lockPaintJournalQuery | ||
| lockPaintJournal.command = ["journalctl", "--user", "-t", "omarchy-shell", "--since", "@" + sinceSec, "-o", "cat", "--no-pager"] |
There was a problem hiding this comment.
Unrelated errors condemn working locks
queryLockPaintJournal() reads every omarchy-shell message in the time window, including other windows and the second before this lock began. If another output or shell window reports an EGL failure while a lock output draws successfully, that line sets presentFailed. The model reports painted: false and unpainted: true, allowing omarchy-restart-shell to kill a working password prompt.
Restrict the failure evidence to this lock's surfaces. A failure elsewhere must not override a working lock output.
| if (state.journal === "idle" && state.startedAtSec > 0) { | ||
| state.journal = "pending" | ||
| queryJournal = true | ||
| } | ||
|
|
||
| if (trusted && (state.journal === "clean" || state.journal === "unavailable" || (state.journal === "idle" && state.settled))) { | ||
| state.painted = true | ||
| state.unpainted = false | ||
| state.committed = true | ||
| state.awaitingSettle = false | ||
| return finish(state, "stop", queryJournal) |
There was a problem hiding this comment.
If the journal read finishes before the first failed swap or before its error reaches the journal, the invisible lock is treated as working. evaluate() requests the read as soon as the lock is secure and has a surface, without waiting for a frame. A later frameSwapped then commits the lock as painted using that earlier clean result, even if the swap failed. No further journal read is requested, so restart refuses recovery.
Check the log after the frame attempt and allow for delayed log delivery before treating that frame as proof.
| assert( | ||
| /function onFrameSwapped\(\) \{[\s\S]*?type: "frame"/.test(serviceQml), | ||
| 'the lock surface records a swapped frame' | ||
| ) | ||
| assert( | ||
| /function onSceneGraphError\(error, message\) \{[\s\S]*?type: "graphics-failed"/.test(serviceQml), | ||
| 'a lock surface that loses its graphics context is recorded' |
There was a problem hiding this comment.
Text checks miss broken connections
These assertions check the new source text rather than its behavior. AGENTS.md explicitly says not to grep source or reread an edited file to confirm the edit. Finding onFrameSwapped in the file does not show that its connection receives frames. The same pattern appears elsewhere in this new test.
Remove these text checks and test the event wiring or status changes instead. This repository requirement must be satisfied before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| run_node_test <<'JS' | ||
| const fs = require('fs') | ||
| const model = requireFromRoot('shell/plugins/lock/LockPaintModel.js') | ||
| const serviceQml = fs.readFileSync(path.join(root, 'shell/plugins/lock/Service.qml'), 'utf8') | ||
| const restart = fs.readFileSync(path.join(root, 'bin/omarchy-restart-shell'), 'utf8') |
There was a problem hiding this comment.
Lock coverage is split unnecessarily
This adds another lock test file despite the instruction in AGENTS.md to extend the area's existing test file. lock-state-test.sh already covers the lock service's state and status, and restart-shell-test.sh covers restart recovery.
Move the new model coverage into the existing lock-area test rather than adding another *-test.sh. This repository requirement must be satisfied before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Withdrawn after follow-up review.
This attempted to recover the invisible lock in #18011 by allowing shell restart when the lock was classified as
unpainted. That classification is not reliable enough to permit killing a live lock client.The journal query covers the whole shell, so an EGL error from another window can classify a working password prompt as unpainted. The one-shot read can also finish before a real presentation failure is logged.
frameSwappedalone does not establish successful presentation. Delaying or filtering the same query does not supply evidence tied to this lock surface.Closing this change preserves the existing restart guard. A replacement needs a trustworthy presentation or mapping signal for the lock surface, plus behavioural coverage; it should not infer permission to kill the locker from journal text. No GPU-pressure reproduction or graphical validation was performed in this follow-up audit.
This began as an unattended GrokBot contribution using spare weekly model allowance to work through Omarchy issues. Codex reviewed the current implementation and checked a bounded Grok 4.7 audit. This attempt should not be presented as a verified fix.