Skip to content

Fix stranded session-lock recovery after plugin reload - #7169

Open
v-t-r-gg wants to merge 3 commits into
omacom:quattrofrom
v-t-r-gg:fix/stranded-lock-recovery
Open

v-t-r-gg wants to merge 3 commits into
omacom:quattrofrom
v-t-r-gg:fix/stranded-lock-recovery

Conversation

@v-t-r-gg

Copy link
Copy Markdown

Fixes #6888.

Problem

Saving any file under ~/.config/omarchy/plugins/ while the session is locked hot-reloads plugins, destroy()s omarchy.lock, and leaves Hyprland holding ext-session-lock with no surface. The lock plugin then logs lock-stranded: recovering → lock-pending: screen-stabilizing and never draws a prompt. Hyprland's failsafe wall tells the user to killall -9 hyprlock, which is not installed on Quattro.

Two outcomes already documented on #6888:

  • Stall: requestSessionLock() returns early on sessionLock.secure, which is true for the orphan failsafe and for a stale Quickshell SessionLockManager::active after an in-process remount.
  • Crash loop: dropping that guard and setting sessionLock.locked = true in the same process hits Quickshell's qFatal("Tried to show lockscreen surfaces without active lock").

omarchy-restart-shell is written to recover a LOCK session with no locker, but it treats .secure || .requested as a healthy lock and refuses — the exact JSON a wedged locker reports.

Approach

Do not remount a live lock client. When an orphan still happens, recover in a new process, not by beginLock() in the same one.

  1. shell/shell.qml — unloadPluginServices() keeps omarchy.lock while it owns the session lock (lockRequested or sessionLock.locked). Skip Qt.clearComponentCache() in that case so the mounted lock's types stay valid.
  2. shell/plugins/lock/Service.qml — treat sessionLock.locked as the only proof this client has a surface. secure && !locked is an orphan: stop the 10 Hz retry and run omarchy-restart-shell. Do not set sessionLock.locked = true in-process (that is the qFatal path).
  3. bin/omarchy-restart-shell — refuse only when .sessionLocked is true. requested/secure without a surface is the wedge and must recover. Relock success is sessionLocked && secure.

hl.clear_crashed_lockscreen() is intentionally not called first: that would drop the compositor lock before the new process can relock.

Tests

  • Updated test/shell.d/lock-stranded-recovery-test.sh for the new recovery contract.
  • Updated test/shell.d/restart-shell-test.sh so a healthy lock still refuses restart, and a wedged secure+requested / sessionLocked=false lock is recovered.
  • Added test/shell.d/plugin-reload-lock-test.sh for the keep-lock reload path.

Focused suites pass. ./test/all CLI suite is green. Three shell files fail in this environment for missing omarchy-pkgs / a non-executable upstream snapper-test.sh; they do not touch this change.

Out of scope

Quickshell still needs to null SessionLockManager::active in ~QSWaylandSessionLock and return after a failed lock() instead of updateSurfaces(true). Until that lands, same-process retake remains unsafe.

Reloading any user plugin destroyed omarchy.lock, left Hyprland's
ext-session-lock failsafe up, then treated sessionLock.secure as a
healthy lock and never drew a surface. Same-process beginLock() also
qFatal's in Quickshell. Keep the live lock client across reloads, and
recover orphans by restarting the shell so a new process can relock.
@v-t-r-gg
v-t-r-gg marked this pull request as ready for review August 16, 2026 19:04
Copilot AI balanced review requested due to automatic review settings August 16, 2026 19:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves recovery from “wedged”/orphaned session-lock states and makes plugin reload safer when the lock service currently owns the session lock.

Changes:

  • Extend lock status semantics to distinguish “secure/requested” from a lock surface actually being mounted (sessionLocked).
  • Update lock recovery logic to treat “secure without surface” as an orphaned lock and recover via omarchy-restart-shell (new-process relock).
  • Add/extend tests covering wedged-lock restart recovery and plugin reload behavior around the lock service.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/shell.d/restart-shell-test.sh Adds a wedged-lock test case and updates lock-status stubs to include sessionLocked.
test/shell.d/plugin-reload-lock-test.sh New regression test asserting plugin reload won’t unload the lock service or clear QML cache while it owns the lock.
test/shell.d/lock-stranded-recovery-test.sh Updates expectations to differentiate sessionLock.locked vs sessionLock.secure and validate restart-based recovery.
shell/shell.qml Preserves omarchy.lock during plugin unload if it owns the lock; avoids clearing component cache while lock client is mounted.
shell/plugins/lock/Service.qml Refines “owned vs secured” semantics, adds restart-based stranded/orphan recovery, and caps lock-attach retries.
bin/omarchy-restart-shell Uses sessionLocked to decide when restart is unsafe and to drive relock polling logic.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"

run_node_test <<'JS'
const fs = require('fs')

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run_node_test in test/shell.d/base-test.sh already prepends const path = require('path') (and root) to every snippet, which is why the other lock tests also use path.join without a local import. This file matches that contract.

Comment on lines 110 to 125
function recoverStrandedLock() {
if (!strandedLock || locked || !passwordPamConfigured) return

if (!passwordPamConfigured) return
if (sessionLock.locked) return
if (strandedRestartAttempted || restartShellProc.running) return

// Same-process beginLock() cannot retake the lock: Quickshell's
// SessionLockManager::active stays set after the previous WlSessionLock
// is destroyed, so lock() fails and updateSurfaces() aborts. A new
// process plus omarchy-restart-shell's relock path is the recovery.
strandedRestartAttempted = true
strandedLock = false
pendingSessionLockTimer.stop()
sessionLockStabilizeTimer.stop()
logEvent("lock-stranded: recovering")
beginLock()
restartShellProc.running = true
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied. recoverStrandedLock() again requires strandedLock and only beginLock()s. The restart path is now a separate restartForOrphanedLock() that requires lockSurfaceOrphaned (secure && !locked).

@ChristopherClure

ChristopherClure commented Aug 16, 2026 •

Copy link
Copy Markdown

Tested this branch (c5e8f09) against a different trigger than the one it targets — lock client killed outright rather than unmounted by a plugin hot-reload — and it ends in a restart loop that leaves the session worse off than the stall it fixes. Flagging before merge.

Context: I hit #6888 for real yesterday while investigating #6628, so I was keen to see this land.

What works

The bin/omarchy-restart-shell change is sound. Replaying both expressions against the actual lock status JSON I captured during a real wedge:

state old .secure or .requested new (.sessionLocked == true) and (...)
wedged (sessionLocked:false, secure:true) true — refuses (the bug) false — recovers ✅
healthy lock (sessionLocked:true, secure:true) true true — still refuses ✅
mid-lock (sessionLocked:true, requested:true) true true ✅
unlocked false false ✅

test/shell.d/lock-stranded-recovery-test.sh also passes on the branch.

The loop

Setup: Hyprland nested inside my session (Wayland backend) with OMARCHY_PATH and PATH pointed at this checkout, so shell.qml, the lock plugin and bin/ all come from the PR. Lock the nested session, then kill -9 the lock client.

shell killed (137)          -> relaunch
  new shell: "lock-stranded: recovering" -> omarchy-restart-shell -> killed (255) -> relaunch
  new shell: "lock-stranded: recovering" -> ... x5
  "Giving up on the Omarchy shell after 6 relaunches in under a minute."
final: compositor LOCKED, no lock client at all

Each cycle takes ~3.5 s. End state is a locked compositor with nothing running — strictly worse than the 10 Hz stall, which at least kept a process alive to recover from.

Why

recoverStrandedLock() now unconditionally restarts the shell instead of calling beginLock(). But a fresh process can take the lock directly — that is how stock recovery succeeds, and I watched it work several times on this machine yesterday before it lost the race once and stranded me. Since every restart produces another fresh process that again elects to restart, it never converges.

Two supporting details:

  • lock-stranded: restart-shell=<code> never appears in the journal, not once. omarchy-restart-shell kills the very shell whose Process is waiting to report its exit, so the new logging can never fire and the script's relock loop dies with its caller.
  • strandedRestartAttempted only guards within a process, so it resets on every relaunch and cannot break a cross-process loop.

Suggested direction

Restarting is only required for the genuine in-process orphan — the stale SessionLockManager::active case where beginLock() would qFatal. That is precisely the condition requestSessionLock() already detects. So something like: try beginLock() first, and restart only when sessionLock.secure && !sessionLock.locked. A fresh process with secure == false should just take the lock.

Caveat on my setup

In the nested compositor the recovered shells reported secure: false, whereas my real host lockout had secure: true — so nesting does not reproduce that property identically, and the exact orphan semantics may differ on real hardware. The loop itself does not depend on secure (it comes from the unconditional restart), but worth knowing before you weigh this.

Happy to re-test any revision the same way — the nested setup makes this safe to iterate on without risking a lockout.

Environment: hyprland 0.56.2-1, quickshell-git 0.3.0.r20.g28771c7-1, omarchy-dev 4.0.0.r1761.g7be59e1-1, kernel 7.1.8-arch1-3.

Filed by Claude Opus 5 via Claude Code.

@ChristopherClure

Copy link
Copy Markdown

Supporting data point: this PR's target scenario just showed up in the wild, with a log that matches the diagnosis in the description almost line for line.

quickshell-mirror/quickshell#959 ("Hyprlock crash on wakeup", filed today, reporter on Omarchy Quattro 4.0.0-1). Decoding the attached .qslog with quickshell log:

Quickshell has crashed under pid 51854
Quickshell has been restarted
omarchy lock ... lock-stranded: recovering
omarchy lock ... lock-requested
omarchy lock ... lock-pending: screen-stabilizing
omarchy lock ... secure=true                      <- recovery succeeded here
Local plugin changed, reloading: jwhall.zerotier  (x4)   <- plugin reload WHILE LOCKED
omarchy idle ... service-ready                    <- plugins remounted
omarchy lock ... lock-stranded: recovering
omarchy lock ... lock-requested
FATAL: Tried to show lockscreen surfaces without active lock

Their backtrace lands exactly where you predicted:

#6 WlSessionLock::updateSurfaces(bool, WlSessionLock*) at src/wayland/session_lock.cpp:106
#7 WlSessionLock::qt_metacall(...)              <- QML property write (sessionLock.locked = true)
#9 QQmlPropertyPrivate::write(...)

So: a user plugin (jwhall.zerotier) changed on disk while the session was locked, the shell remounted plugins and unmounted the lock service, and the same-process beginLock() retry hit the qFatal because Quickshell's SessionLockManager was stale. That is the "crash loop" half of your problem statement, observed on someone else's machine, and it confirms the premise that recovery cannot happen in the same process.

Two notes for whoever picks this up:

  1. This is a real argument for landing something here soon — the failure is reaching users, not just theory.
  2. It does not change the restart loop I reported above. The premise (do not remount a live lock client; do not beginLock() in-process) is right; it is the recovery mechanism that needs another pass, since recoverStrandedLock() restarting unconditionally means a fresh process — which could simply take the lock — restarts instead, and every relaunch resets strandedRestartAttempted.

Happy to re-test any revision against both triggers (plugin reload, and lock client killed outright) in the nested-Hyprland setup.

Filed by Claude Opus 5 via Claude Code.

Unconditional restart looped: a fresh shell saw the same compositor
LOCK and killed itself again until the crash handler gave up. Stock
recovery already works when SessionLockManager is clean, so beginLock()
there. Restart only when secure && !locked, the stale in-process case
that qFatal's on sessionLock.locked = true.
@v-t-r-gg

Copy link
Copy Markdown
Author

Thanks @ChristopherClure — the restart loop is real and the suggested split is the right one.

recoverStrandedLock() now goes back to stock beginLock() for a fresh process (compositor LOCK, secure == false). Restart is reserved for restartForOrphanedLock(), which only runs when sessionLock.secure && !sessionLock.locked — the stale in-process SessionLockManager::active case that qFatals if we set sessionLock.locked = true here.

That should stop the kill-9 / crash-handler loop: every relaunch is a new process that can take the lock instead of killing itself again. strandedRestartAttempted still limits the orphan restart to once per process.

Pushed in 9112a85. Happy to have you re-run both triggers (plugin reload while locked, and lock client killed outright) in the nested compositor if you still have that setup.

@ChristopherClure

Copy link
Copy Markdown

Retracting my restart-loop report. @v-t-r-gg — I'm sorry, you rewrote this based on a finding I can't support. My test harness was incapable of testing this code path, and I misread the evidence.

The control that exposed it

I re-ran 9112a85 and still saw a loop, which was suspicious given the change looked correct. So I ran the same trigger against the stock packaged tree (OMARCHY_PATH=/usr/share/omarchy, isolated XDG_CONFIG_HOME, same nested compositor, same kill -9 of the lock client while locked).

Stock fails identically: 5 × fatal error: Invalid argument, then Giving up on the Omarchy shell after 6 relaunches in under a minute. No PR code involved.

Nested Hyprland (Wayland backend) cannot take over a stranded ext-session-lock at all — any fresh client attempting it dies on a fatal protocol error. On real hardware it works: on my host, stock recovery succeeded repeatedly on 2026-08-15 (lock-stranded: recovering → secure=true). So the harness cannot test stranded-lock recovery, which is this PR's whole subject. Both my runs against it are void.

What I misread

Going back to my original c5e8f09 run, every relaunch shows this:

omarchy lock ... lock-stranded: recovering
WARN: The Wayland connection experienced a fatal error: Invalid argument
Omarchy shell exited with status 255; relaunching.

Those shells were dying of the Wayland protocol error (the #6628 crash), not because omarchy-restart-shell killed them. I also cited "lock-stranded: restart-shell= never logged once" as proof the script was killing its own caller — backwards: it never logged because the shell died of the protocol error before the Process could report an exit. I presented a harness artifact as a confirmed blocking defect, with a mechanism I had inverted.

Where that leaves the PR

  • The restart loop I reported is unproven. Please judge 9112a85 on its own merits, and don't treat my report as a reason the c5e8f09 approach was broken.
  • Reading the code, c5e8f09's recoverStrandedLock() did restart unconditionally, and a fresh process being able to take the lock directly still seems worth the distinction 9112a85 makes — but that is a code-reading opinion, not something I measured, and it should be weighed as such.
  • The bin/omarchy-restart-shell refusal-check validation in my first comment stands: that was replaying both jq expressions against real captured lock status JSON, with no compositor involved.
  • The quickshell#959 evidence stands too — that is an independent user's log, not my harness.

I'm not going to claim a working test setup for this path until I have one that can demonstrably recover a stranded lock with stock code first. Apologies for the churn.

Filed by Claude Opus 5 via Claude Code.

@v-t-r-gg

Copy link
Copy Markdown
Author

Thanks for the correction, and no harm done.

We will keep 9112a85 on its own merits: a fresh process still takes the compositor lock with beginLock(), and restartForOrphanedLock() stays reserved for secure && !locked, which is the in-process stale-manager case that qFatals. That split was already the safer control flow; your first report was not the only reason for it.

Agreed that the nested compositor cannot speak to this path until stock recovery works there first. The omarchy-restart-shell jq check and the quickshell#959 log remain the measured pieces.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed as part of a pass over everything opened since v4.0.0. This is a reading of the diff against main — the tests were not executed.

The central diagnosis is right and worth keeping. sessionLock.secure really is ambiguous: it is also true for Hyprland's dead-client failsafe, so treating it as proof that this client holds a lock is what makes requestSessionLock() return early forever and leaves the session on "lockscreen app died" in #6888. Splitting lockOwned from sessionSecured and deriving lockSurfaceOrphaned from the pair is the right shape, and routing an in-process orphan through omarchy-restart-shell rather than beginLock() matches the constraint named in the comment — SessionLockManager::active stays set after the previous WlSessionLock is destroyed, so retaking it in the same process cannot work. The narrowed guard in omarchy-restart-shell is consistent with the shell: sessionLocked is already published by the status IPC handler on main, so (.sessionLocked == true) and (.secure == true or .requested == true) reads a field that genuinely exists, and it now refuses only for a lock this client is actually drawing.

One finding that should be resolved before this merges.

The new attempt cap can leave a session unlocked while reporting itself locked. pendingSessionLockTimer gains:

attempts += 1
if (attempts > 50) {
  stop()
  attempts = 0
  root.logEvent("lock-pending: gave-up")
  if (root.lockSurfaceOrphaned) root.restartForOrphanedLock()
  return
}

On main this timer retries indefinitely. With the cap it gives up after 50 ticks at 100 ms, and sessionLockStabilizeTimer is a 500 ms one-shot, so roughly 4.5 seconds of real attempts. The path that matters is requestSessionLock()'s own early return when !hasRealScreen(): if no real output is available for longer than that — a resume, a dock reconnect, a slow hotplug, the kind of thing #7328, #7209 and #7228 already describe on this hardware — the timer stops and nothing re-arms it, so the lock never engages. Giving up also does not clear lockRequested, and locked is lockRequested || lockOwned || sessionSecured, so the shell then reports itself locked with no lock surface on screen. A lock that silently does not happen is worse than the wedge being fixed here, because the user cannot see it.

Clearing lockRequested on the give-up path would fix the false state but not the missed lock; re-arming when a real screen appears, or exempting the no-screen case from the cap, would address both.

Two smaller notes. restartForOrphanedLock() is one-shot per process via strandedRestartAttempted, and restartShellProc.onExited only logs the exit code — a restart that fails to start or fails midway leaves the user on the dead-lockscreen wall with no further attempt, so it is worth deciding whether a non-zero exit should retry. And in lock-stranded-recovery-test.sh the assertion /logEvent\("lock-stranded: recovering"\)\s*\n\s*beginLock\(\)/ already passes against the unfixed code, since those two lines are unchanged, so it does not establish the claim it is labelled with; several of the other assertions also require exact line adjacency and will break on reformatting that preserves behaviour.

Waiting on the author for the attempt cap. The rest of the change is sound and the underlying fix is one worth landing.

`sessionLock` is an id inside Service.qml, so `root.sessionLock` is undefined: `root.sessionLock.locked` threw a TypeError in strandedLockCheckProc.onExited, aborting the handler before `strandedLock` was assigned and before recoverStrandedLock() could run. strandedLockResolved is set earlier in the same handler, so the check never re-armed and stranded-lock recovery was dead for the life of the process — including the recovery quattro already performs today. lockServiceOwned() reached that same id from outside the document, where `lockInst.sessionLock` is undefined too, leaving its last clause permanently false; the service already exposes lockOwned for exactly this.

Proven on a worker with a real compositor: the shell logged `TypeError: Cannot read property 'locked' of undefined` at Service.qml:443 on every start and never recovered a stranded session; with this change it logs `lock-stranded: recovering` and re-secures the session.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 9112a853. The approach holds up and the central guard demonstrably works, but the recovery half had a defect that made it a no-op. I pushed a fix to this branch as 25ee6d27; three things are left for you.

Verified working. On a disposable VM with a real compositor, locking the session and then running omarchy-shell shell rescanPlugins left the shell process untouched and the lock unbroken — same pid, sessionLocked/secure still true throughout, other services reloaded around it. With lockServiceOwned() forced to false to simulate quattro, the same sequence destroyed the lock service and left Hyprland holding LOCK in solitaryBlockedBy while the replacement service reported locked:false, lastEvent:"init" — the stranded state from #7106, reproduced. The shell.qml guard is doing real work.

Fixed and pushed — Service.qml:443 threw on every startup. sessionLock is an id, not a property of the root Item, so root.sessionLock is undefined and root.sessionLock.locked raised TypeError: Cannot read property 'locked' of undefined. Qt aborts the rest of that signal handler, so strandedLock was never assigned and recoverStrandedLock() never ran — and because strandedLockResolved = true executes earlier in the same handler, the check never re-armed. Stranded-lock recovery was dead for the life of the process, including the recovery quattro already performs today. This is not inference: the running shell logged that TypeError at Service.qml:443 on every start, and with root. dropped it instead logs lock-stranded: recovering and re-secures the session. qmllint flags the same line as Member "sessionLock" not found on type "Service", and that diagnostic is gone after the fix. One of the new assertions in lock-stranded-recovery-test.sh pinned the broken expression exactly, so it locked the defect in rather than catching it; I updated it.

Also fixed — shell.qml:352 could never be true. lockInst.sessionLock reaches the same id from outside the document, so !!(lockInst.sessionLock && lockInst.sessionLock.locked) short-circuits to false always. It does not throw, and lockRequested covers a normal lock, so the guard still worked — but the fallback clause was inert. It now reads lockInst.lockOwned, the property the service already exposes, with an assertion pinning it.

Still open — restartForOrphanedLock() kills the process that is supposed to restart the shell. restartShellProc is an ordinary Quickshell Process, and omarchy-restart-shell runs quickshell kill at line 68 before relaunching at line 72. I tested the lifetime directly on the VM: under SIGTERM a Process child survives and reparents to init, but under quickshell kill — the graceful IPC exit this script actually triggers — the child is destroyed with the shell. So the script dies at line 68 and never reaches the relaunch, leaving the compositor locked with no shell and no authentication UI. Detaching it (or dispatching through Hyprland the way the script itself does) would avoid this, but which way you want to go is your call rather than mine to push.

Still open — _syncServices() bypasses the guard. It destroys services for plugins that became disabled or disappeared without consulting lockServiceOwned(), so disabling or removing omarchy.lock while locked still strands the session. Ordinary rescans are covered; this path is not.

Still open — the new 50-attempt give-up can report a lock that does not exist. When pendingSessionLockTimer gives up it stops retrying without clearing lockRequested or pendingSessionLock, and locked is lockRequested || lockOwned || sessionSecured — so lock status and lock isLocked report true with no compositor lock held and the desktop visible. onScreensChanged usually rescues it, but not if a screen becomes usable without the screen list changing. Before this PR the timer retried indefinitely, so this state is new.

One housekeeping note: this is filed as Fixes #6888, and on the evidence above it also closes #7106 — worth adding so both close together. #7572 and #7605 overlap with this; #7605 leaves the rescanPlugins path open and #7572 prevents without recovering, so this is the more complete of the three. Which one lands is the maintainer's decision, and I have not touched the others.

What ran: test/shell.d/lock-stranded-recovery-test.sh, plugin-reload-lock-test.sh and restart-shell-test.sh through the compositor-backed wrapper (24, 4 and 8 assertions, all passing with the fix), plus ./test/cli (116 passing). All on a disposable VM, never locally.

Reviewed by Claude Opus 5 and by Codex at xhigh as an independent second reviewer. Codex found the restartShellProc lifetime problem, which I had not reasoned about and then confirmed by direct experiment, and it independently reached the Service.qml:443 and shell.qml:352 conclusions via qmllint. Its independence is not fully guaranteed — it runs with read access to this session — so the items above rest on the reproductions and the tests rather than on agreement. I rejected nothing it raised outright, but its claim that a freshly remounted service reports secure == true did not match what I measured: the replacement service read secure:false while the compositor still held the lock, which suggests the lockSurfaceOrphaned path may not trigger in the plugin-reload case it is written for. Worth a look, since that is the scenario the orphan branch exists to serve.

@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again against current quattro. The head is unchanged since 25ee6d27, but quattro has moved underneath it and the PR no longer merges. Here is where it stands.

Now redundant: the shell/shell.qml half. #9485 (d3d23fdd) keeps every keepLoaded service mounted across plugin reloads, and omarchy.lock declares keepLoaded: true, so a plugin write while locked no longer destroys the lock client. quattro also moved authentication services out of _services and into AuthServiceStore (shell/shell.qml around line 924). lockServiceOwned() in this PR looks up _services["omarchy.lock"], so on today's tree it would never find the lock and would always return false. Resolving the conflict in shell/shell.qml means deciding to drop that half, including the Qt.clearComponentCache() guard that depends on it. That changes the PR's scope, so I have left it to you. The conflict in test/shell.d/restart-shell-test.sh is mechanical: keep both appended cases.

Still needed: the #6888 recovery half. quattro still returns early on sessionLock.secure in requestSessionLock() (shell/plugins/lock/Service.qml:78), and bin/omarchy-restart-shell still refuses on .secure or .requested without looking at .sessionLocked. The distinction this PR draws between a lock the client is drawing and a stale secure flag is still the fix #6888 needs.

Still open from the last review:

  • restartForOrphanedLock() runs omarchy-restart-shell as a child Process of the shell. The script's quickshell kill then tears that shell down before the script reaches the relaunch line. Quickshell 0.3.1 (Switch back to the packaged quickshell now that 0.3.1 kills synchronously #7769) did not change this: destroying a Process still kills its child. Recovery needs a launcher that outlives the shell it restarts, such as dispatching through Hyprland the way the script launches the shell.
  • The 50-attempt give-up in pendingSessionLockTimer stops retrying without clearing lockRequested. locked and lock isLocked then report true with no compositor lock, and a later lock lock returns ok without trying again. quattro retries indefinitely there.

The third item from last time, _syncServices() destroying the lock on disable, is now being worked in #7572 and #12937. It can stay out of this PR.

Related: #10547 takes a different route to the same omarchy-restart-shell refusal: a --force flag instead of reading .sessionLocked. #8930 also reworks lock recovery. Which approach lands is the maintainer's decision.

What ran: nothing new. The compositor-backed tests from the last pass (lock-stranded-recovery-test.sh, plugin-reload-lock-test.sh, restart-shell-test.sh, ./test/cli) ran at this same head. Running them again would not say anything about what would land after the conflict is resolved, so I did not spend a worker on it. This time was a reading of the head against quattro at 3faafba2.

Reviewed by Claude Opus 5.5, with Codex at medium effort as a second reviewer. Codex found that lockServiceOwned() can no longer find the lock service now that quattro keeps it in AuthServiceStore, which I then confirmed in the source. It agreed with the rest; independence is not guaranteed, since it can read this session.

Waiting on the author: a rebase onto quattro that drops the superseded shell.qml half, plus fixes for the two recovery defects above. Once that lands it will be run on a worker again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stranded-lock recovery never completes: requestSessionLock() early-returns on sessionLock.secure, so the session stays on "lockscreen app died" forever

4 participants