Skip to content

Fix fingerprint enrollment and lock-screen recovery - #7158

Merged
dhh merged 19 commits into
omacom:quattrofrom
GeertJohan:lock-fingerprint-recovery
Oct 4, 2026
Merged

dhh merged 19 commits into
omacom:quattrofrom
GeertJohan:lock-fingerprint-recovery

Conversation

@GeertJohan

@GeertJohan GeertJohan commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Fingerprint detection mistakes “no fingers enrolled” for an enrolled print, while failed probes and stuck reader claims can leave fingerprint unlock disabled or retrying continuously after suspend. Some readers also prompt and then immediately fail, including when libfprint disables them to prevent overheating.

Require an actual enrolled-finger row in both setup and the lock service, retaining the privileged /usr/bin/fprintd-list pin. Unknown probes preserve existing configuration. Initial unknown enrollment gets paced rechecks and an unavailable notice; a known enrollment recovers through PAM without a competing probe loop. Setup reports success only when fingerprint PAM exists, and installs recovery files before enabling it.

Back off attempts that never prompt or fail immediately after their first prompt. Ordinary mismatches and full scan timeouts stay responsive. The capped wait leaves room for daemon idle recovery and lets a thermally disabled reader cool without resetting its temperature state; keyboard and pointer activity can advance retries while preserving that idle window. A post-resume hook queues an fprintd restart, with a three-second stop timeout, and the lock discards stale conversations during resume recovery. The migration installs missing recovery files on existing setups, and fingerprint removal removes them.

Includes Karl Ahlin’s enrolled-entry matcher from #9551 and Geert-Johan Riemer’s original recovery work. Restarting fprintd on resume drops other active fingerprint requests, which may need their password fallback.

Fixes #7229. Fixes #7172. Fixes #9453. Fixes #7176.

Copilot AI balanced review requested due to automatic review settings August 16, 2026 16:44

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@GeertJohan
GeertJohan force-pushed the lock-fingerprint-recovery branch from b26c201 to edb63d5 Compare August 16, 2026 16:59
Copilot AI review requested due to automatic review settings August 16, 2026 16:59

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@GeertJohan GeertJohan changed the title Lock screen: recover fingerprint auth from suspend races, and say when the reader is unavailable Lock screen fix: recover fingerprint auth from suspend races, and show when the reader is unavailable Aug 16, 2026
@paracycle

Copy link
Copy Markdown

Same signature here on a Framework 13 (AMD Ryzen AI 300), Omarchy 4.0.0-1, found while chasing an unrelated resume bug: 45 omarchy-lock-fingerprint PAM subprocesses in the first 65 s after resume, every one failing with code 9 (PAM_AUTHINFO_UNAVAIL), stopping only when the password was typed. The 250 ms timer in Service.qml is exactly the multiplier, so the backoff here is the right lever.

One data point that may be worth folding in: dropping a systemctl try-restart fprintd.service into a post sleep hook took the same machine from 45 spawns to 2 on the next resume. Clearing the wedged claim at resume and backing off on device errors are complementary — the backoff stops the storm, the restart makes fingerprint actually usable again on the first touch instead of after fprintd's 30 s idle exit. #7229 asks for the restart specifically.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed against quattro at edb63d5, alongside #7179, #7172, #7176, #7229 and #7645. Read-only — nothing pushed. The retry storm and the wedged claim are both real and your diagnosis matches what the reporters' journals show. Three things below would stop this doing what the description says on hardware, and one note on how it relates to #7179.

1. Service.qml:400 zeroes the streak on every armed verify

onPamMessage: {
  if (!messageIsError && root.fingerprintErrorStreak > 0) root.fingerprintErrorStreak = 0
}

The reasoning holds for the failure mode you reproduced. A claim that never lands relays no finger prompt, so the streak climbs, retryDelayMs() walks 1s/2s/4s… and the notice appears after about three seconds. That case works, and so does #7172's and #7229's — both fail before the verify starts.

It inverts once the claim succeeds and the verify is what errors. pam_fprintd relays the finger prompt as PAM_TEXT_INFO, and Quickshell maps only PAM_ERROR_MSG to messageIsError (subprocess.cpp:170). #7176's journal shows the pair on every cycle of a 41,324-error day:

Relaying pam message: "Swipe your right index finger across the fingerprint reader" echo: 1 error: 0 responseRequired: 0
Error while authenticating: "Authentication service cannot retrieve authentication info" (code 9)

So per attempt: prompt → streak 0 → error → streak 1 → retryDelayMs(1) = ERROR_RETRY_BASE_MS = 1000 ms. Every time. That is 4x better than the 250 ms you replaced, but it is one PAM session per second forever — never the 30 idle seconds the 40s ceiling was chosen to allow, and fingerprintUnavailable (:46, streak ≥ 3) is unreachable, so the icon keeps inviting touches. There is a smaller version of the same problem in the other direction: if the streak did reach 3 from pre-verify failures, the next attempt that gets as far as the prompt clears the notice a moment before that attempt fails.

lock-fingerprint-retry-test.sh exercises retryDelayMs() in isolation and the indicator fixture assigns fingerprintUnavailable by hand, so neither can see this.

I have not pushed a fix. Which signal means "the device recovered" is exactly what #7179 also has to decide, and it should be decided once rather than twice.

2. fingerprintPam.abort() is a SIGKILL, not a release

The description's mechanism is that pam_fprintd "releases its device claim while the sensor is still awake". What beginSleepHold() (:263) actually reaches is PamContext::abort() → abortConversation() → deleteLater() → ~PamConversation() → kill(childPid, SIGKILL) (conversation.cpp:54-58). pam_sm_authenticate never returns and pam_end (subprocess.cpp:125) never runs, so pam_fprintd never calls ReleaseDevice. The claim goes away only when fprintd notices the killed client's bus connection drop — asynchronously, with nothing acknowledging it. prepareForSleep() returns "ok" (:618) having only queued the deletion.

Killing the verify early is probably still better than letting it ride into suspend, and the inhibitor is held while the rest of the lock runs, so in normal timing this likely helps. But it is not the deterministic, acknowledged release the description claims, which matters because that claim is the reason to prefer this over #7229's approach of restarting fprintd outright.

3. The resume relay is not deliverable, so a short lid cycle parks fingerprint for ~2 minutes

consume_sleep_events returns on boolean true (omarchy-system-sleep-monitor:14), which tears down dbus-monitor and exits the unit before the machine suspends. With RestartSec=2 (omarchy-sleep-lock.service:16) the replacement subscribes after logind has already emitted PrepareForSleep(false), and D-Bus does not replay a signal to a later subscriber. So resumedFromSleep arrives only if some other inhibitor happens to delay the suspend long enough — not in the normal path.

That leaves the fallback probe, which releases on gap > interval + 8000 || heldForMs > 120000 (:436). #7172's reproduction is a ~1-second lid close, so the wall-clock gap between ticks is ~3s, under the 10s threshold, and it falls through to the budget — releasing on the 61st tick, ~122s later. The user is not told: sleepPending does not feed fingerprintUnavailable (:46), so the ordinary icon is showing the whole time. resetAuthenticationState() (:124-135) also clears neither sleepPending nor the probe, so an unlock and relock inside that window starts with fingerprint still parked.

sleep-monitor-test.sh:108 mocks one dbus-monitor instance printing boolean false then boolean true, which is the arrangement that cannot occur — it encodes the assumption rather than checking the delivery.

On #7179, since it decides how this lands

These are not two fixes for one bug, and the merge is not a choice between them. #7158's cause is a claim wedged by a verify racing suspend (#7172, #7229); #7179's is libfprint's duty-cycle cut-off (#7176), which trips on a machine that never suspends. Neither reaches the other's cause: #7179 touches nothing under bin/ and has no pre-suspend abort or resume path, while #7158 has no arming policy and no disarm in runBlank() (:181) — and because of (1), it does not meaningfully pace the thermal case either. They overlap on exactly one thing, "back off on device errors", which is both what makes them conflict in Service.qml (confirmed with git merge-tree at edb63d5 / 6aec521) and what has to be written once. Both defects need fixing; how they combine is the maintainer's call.

Worth knowing in both directions, because the merged version has to avoid both: your recovery signal misfires when the verify is what fails, and #7179's — an attempt shorter than fingerprintFastErrorMs (2000 ms) counts as a device error, anything longer resets the streak — misfires when an attempt is merely slow. It measures with Date.now(), so an attempt that starts before a suspend and errors after it reads as many seconds long and is classified as a swipe timeout. That is precisely the post-resume attempt this PR exists for. @paracycle's trace in this thread also sits at roughly 1.2s per attempt, inside that window but not by much.

And @paracycle's point about #7229 stands on its own: clearing the wedged claim at resume and pacing the retries are different levers, and 45 spawns → 2 is a bigger effect than either PR's backoff can produce, because it removes the wedge instead of waiting it out.

On #7645

That crash is upstream and neither PR causes or fixes it. PamSubprocess::conversation() frees the caller's out-parameter rather than the buffer it allocated — subprocess.cpp:204 frees responseArray, where :161 calloc'd responses — reached by goto fail when a pipe write fails (:182, :187, :188). Fewer PAM sessions only means less exposure to it. For what it is worth, this PR cannot produce the two-simultaneous-conversations shape #7172 hypothesised: PamContext refuses to start a second conversation while one exists (qml.cpp:25), and every path into startFingerprint() (:275, :289, :417, :461) is behind the guard at :220.

What was checked

The diff, Quickshell 0.3.0.r20's PAM sources, and the journals in #7172/#7176/#7229/#7645. No tests were run this pass — the worker fleet was at capacity — so this rests on source rather than execution. An earlier pass at this same SHA ran ./test/cli and the lock suites green on a worker, and every finding above passes them, so a green run would not have changed anything here. Nothing was reproduced on hardware; none of us has your reader.

A second reviewer (codex, xhigh, read-only) reached (1), (2) and (3) independently, though its independence is not currently guaranteed. Its own contributions were the notice-flicker case in (1), the Date.now()-across-suspend misclassification in #7179 above, and that repeated prepareForSleep calls reset the 120s budget each time (:265), so the new IPC lets any process in the session park fingerprint auth indefinitely. That is a nuisance rather than a bypass — the password path is untouched — but it is new surface on a lock screen.

Waiting on you for (1) and (3); on the maintainer for how this and #7179 combine.

@GeertJohan
GeertJohan force-pushed the lock-fingerprint-recovery branch from edb63d5 to 294e558 Compare August 23, 2026 17:39
@GeertJohan GeertJohan changed the title Lock screen fix: recover fingerprint auth from suspend races, and show when the reader is unavailable Keep the lock screen fingerprint working across suspend, and show when the reader is unavailable Aug 23, 2026
@GeertJohan

Copy link
Copy Markdown
Contributor Author

#7158 has been reworked. It is now three layers: a post system-sleep hook that restarts fprintd on resume, exponential backoff on the retry path, and a "reader unavailable" notice — replacing the pre-suspend announce/park and the resume relay.

On the three findings:

  • (3) undeliverable resume relay — removed. Resume is now a system-sleep hook, the guaranteed post-resume signal; no dependence on the user-service monitor's restart timing or on D-Bus replaying PrepareForSleep(false).
  • (2) SIGKILL-not-release — removed. There is no pre-suspend abort; the wedged claim is cleared by restarting fprintd on resume (a fresh daemon holds no claim), which is deterministic rather than an early kill.
  • (1) recovery signal — changed. The streak now counts attempts that fail to reach the reader (no finger prompt relayed), not verify outcomes. A verify that errors after a prompt counts as reached and clears the streak, so it no longer inverts or pins at one step, and a healthy-but-untouched reader never trips the notice. The Date.now()-across-suspend misclassification does not apply — there is no elapsed-time heuristic here.

This does touch Service.qml again, so it overlaps #7179 on the retry path — but on a different signal: claim-reachability (wedged/held/absent) here versus verify duty-cycle (thermal) there. Behaviorally this PR leaves the thermal verify-error case to #7179; the merge of the two retry paths is the maintainer's call.

The repeated-prepareForSleep budget reset is also gone — there is no such IPC anymore. #7645 remains an upstream Quickshell bug, untouched here.

@GeertJohan

Copy link
Copy Markdown
Contributor Author

@omarchybot please re-review

@GeertJohan

Copy link
Copy Markdown
Contributor Author

The PR description is updated to reflect the new implmentation.

@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed the rework at 294e558 (Opus 5, with an independent second opinion from Codex at xhigh — its independence is not currently guaranteed, so where it only agreed with something already concluded that is said below; the first finding is one it contributed and I had not reasoned about). Tests ran on a disposable Omarchy VM, not read: lock-fingerprint-retry-test.sh (16), fprintd-resume-hook-test.sh (4), fprintd-resume-migration-test.sh (3), lock-fingerprint-indicator-test.sh, plus the adjacent fingerprint-invitation, hw-fingerprint, lock-blank-fingerprint, lock-stranded-recovery, lock-password-overflow, sleep-lock, system-lock and hyprland-session-locked files and ./test/cli — all green, on a worker with the compositor serving this branch.

The four open findings

All four are answered. (1) is genuinely fixed for the family it targets: a claim that never lands relays no message, so the streak advances — #7172's and #7229's journals show the storm as bare code 9 with no Relaying pam message line, which is exactly the signal you keyed on. (2) and (4) are moot, the pre-suspend abort and the sleep IPC are gone. (3) is moot, the relay is gone. The sub-point about the notice clearing a moment before an attempt fails is also gone — but it has been replaced by the inverse, below.

1. The resume hook could hold the resume open — fixed, pushed as 07c9558

system-sleep hooks run with user.slice frozen, and systemctl waits out the whole stop/start job. Measured on an Omarchy worker against default/systemd/system-sleep/fprintd-resume:

fprintd.service hook blocked
absent 23 ms
healthy 17 ms
ignores SIGTERM 5.07 s (Omarchy's DefaultTimeoutStopSec=5s)
never reaches its bus name (Type=dbus, TimeoutStartUSec=1min 30s) 100 s

systemd-suspend.service has TimeoutStartUSec=infinity, so nothing above the hook cuts that short. Both slow cases are the wedged daemon this hook exists to clear, and both halves have a way to be slow at exactly this moment — the stop is the daemon that is "still busy with another operation", and the start is libfprint probing a reader that is mid-re-enumeration (#7172's journal shows usb 3-7: reset full-speed USB device number right there). A hundred seconds of frozen user.slice on resume reads as a machine that did not wake.

Your own sibling hook already knows this. default/systemd/system-sleep/unmount-fuse, same directory:

if [[ $1 == "post" ]]; then
  # Run in background — user.slice is still frozen at this point, so a
  # synchronous restart would block the thaw for up to 90 seconds.

Pushed a bound rather than backgrounding, because backgrounding gives up the ordering you deliberately designed for ("fprintd is fresh before the lock screen retries") and a ( ... ) & subshell in a Type=oneshot unit's cgroup is not a job systemd owns:

timeout 10s systemctl try-restart fprintd.service 2>/dev/null || true

timeout kills only the client — the restart job stays enqueued and lands regardless. Confirmed on the worker: timeout 2s systemctl try-restart returned at 2.009 s with rc=124 and fprintd's MainPID still went 44036 → 44062. With the bound in place the never-starts case drops from 100 s to 10 s and the restart still lands; the other three rows are unchanged. Your four hook assertions still pass — the mocked systemctl sees the same argv. The bound itself has no test, because any test of it costs the bound in wall clock; --no-block instead of timeout is the other shape and I did not choose it for you.

Codex found this one, including the unmount-fuse precedent. It is the one place its review contributed something the first pass had not reasoned about.

2. A relayed prompt does not prove the reader works [medium, open]

The predicate at Service.qml:231-233 is that a non-error PAM message means the claim landed and the verify is live. The first half holds. The second does not: fprintd emits VerifyFingerSelected as soon as it has launched the libfprint operation, and pam_fprintd turns that into the PAM_TEXT_INFO you read — the hardware has not demonstrated anything yet.

#7176's journal is the case, on every one of 41,324 cycles:

Relaying pam message: "Swipe your right index finger across the fingerprint reader" echo: 1 error: 0 responseRequired: 0
Error while authenticating: "Authentication service cannot retrieve authentication info" (code 9)

error: 0 sets fingerprintAttemptReachedDevice, so the streak settles to 0 and the next retry is retryDelayMs(0) = MATCH_RETRY_MS = 250 ms — bit-for-bit what quattro does today, and fingerprintUnavailable never fires. You scope the thermal cut-off out and say so plainly, which is fair. Worth saying in the description that the scope is wider than thermal: any failure arriving after the claim lands reads as reached, so a reader that disconnects or whose driver fails mid-verify also gets neither the backoff nor the notice.

3. The notice says "unavailable" while the reader is live [medium, open]

noteFingerprintReachedDevice() (Service.qml:234-236) sets only the per-attempt flag; the streak — and so fingerprintUnavailable (:46) — does not move until settleFingerprintAttempt(). So once the streak is at 3 and the reader comes back, the prompt arrives, the reader will accept a touch, and the screen keeps saying Fingerprint reader unavailable until that attempt settles — up to pam_fprintd's ~30-second verify timeout if nobody touches it. The description says the notice is "cleared the instant the reader is reachable again"; the code clears it one attempt later.

Not pushed, because the fix is a choice and it is the same choice #7179 has to make. Gating the property on the in-flight flag keeps the streak per-attempt for the backoff and clears the notice at the prompt:

readonly property bool fingerprintUnavailable: fingerprintConfigured && !fingerprintAttemptReachedDevice && FingerprintModel.isUnavailable(fingerprintErrorStreak)

That does not reintroduce the flicker from the last round: once fingerprintAttemptReachedDevice is true, settling sets the streak to 0 anyway, so the notice stays cleared rather than blinking back. Codex raised this independently and proposed clearing the streak on the message instead; either shape works.

4. Nothing lets the user force a retry [medium, open]

At the 40 s cap a recovered reader goes unnoticed for up to 40 s, and there is no way to shorten it — touches, keypresses and cursor movement reach onWakeRequested → runWake() (Service.qml:316), which wakes the display and re-arms blanking but never touches fingerprintRetryTimer. The user standing in front of the machine pressing keys is the strongest available evidence that it is worth trying the reader again, and it is discarded. #7179 adds exactly this ("re-arm on user presence"), which is another reason the two want deciding together.

5. The restart drops another session's live verify [low]

The description covers the abandoned claim. It does not cover a live one: a sudo prompt left waiting on a TTY across a lid close loses its conversation on resume and falls back to a password. Probably the right trade, but the hook's "a healthy resume pays nothing" is only true while fprintd is not running — it idle-exits after 30 s, so this is narrow, not impossible.

#7179 and #7645

They conflict textually, confirmed rather than assumed: git merge-tree of this head against #7179's 6aec521 reports CONFLICT (content): Merge conflict in shell/plugins/lock/Service.qml. Whichever lands second needs a hand rebase, and findings 2, 3 and 4 above are all places where the two PRs are answering the same question differently. Neither should be closed for the other — this drains the claim-failure storm (#7172, #7229) and that one drains the thermal one (#7176) — but the retry path wants to end up as one design. Maintainer's call.

#7645 is not widened. The crash is quickshell's PAM helper faulting when the shell dies mid-conversation; the hook kills fprintd, not the shell, and pam_fprintd returns through its normal error path. If anything the backoff reduces the overlapping-conversation pressure the reporter saw — but it is still an upstream bug and this does not fix it.

Checked and clear

The 󰺱 glyph (U+F0EB1) is well inside the range the repo already draws (up to U+F1AD0). The /usr/lib/systemd/system-sleep path and sudo cp -p match omarchy-hibernation-setup and omarchy-toggle-hybrid-gpu. The migration's env-var overrides, || exit 0 guard and sudo install -Dm755 all match existing migrations, it is idempotent, and it correctly no-ops for a second user on the same machine. messageIsError does resolve unqualified inside onPamMessage — confirmed against quickshell 0.3.1's quickshell-service-pam.qmltypes, where it is a property on PamContext. pre/post handling is right for suspend, hibernate, hybrid-sleep and suspend-then-hibernate, and try-restart is right for a dbus-activated unit that is absent or masked. The double-settle guard holds — onError and onCompleted from one attempt fold in once — and the streak resets on unlock.

One pre-existing thing this makes newly touchable, not a blocker: Service.qml:420-424 sets fingerprintConfigured = false on any fprintd-list failure and nothing re-checks it for the rest of the lock, so a check still in flight when the machine suspends can come back against the daemon your hook is restarting and turn fingerprint off for that whole lock session — with the icon gone and the new notice unreachable, since it is gated on fingerprintConfigured.

Waiting on you for 2, 3 and 4, and on the maintainer for how this and #7179 end up sharing the retry path.

@GeertJohan

Copy link
Copy Markdown
Contributor Author

Findings 1, 3 and 4 are addressed; 2 and 5 are description fixes.

  • (1) resume holding the thaw: kept your 07c9558d timeout bound as pushed.
  • (3) notice lingering after recovery: fingerprintUnavailable is now gated on the in-flight reach, so a relayed prompt clears it at once rather than a settle later. No flicker — settling then zeroes the streak, so it stays cleared.
  • (4) no user-forced retry: a keypress, touch or cursor move now collapses a backed-off wait to a prompt retry — but only a wait longer than the fast interval, so once collapsed further input leaves it alone and typing a password cannot respin the loop.

Description changes for the rest:

  • (2) the scope note now states the "reached" signal is wider than thermal: any failure arriving after the claim lands — a mid-verify refusal, a disconnect, a driver error — reads as reached and gets neither the backoff nor the notice here.
  • (5) the stale-claim note now also covers a live verify caught across the suspend (a sudo prompt on a TTY) being dropped to a password, and qualifies "a healthy resume pays nothing" to while fprintd is not running.

On the pre-existing fingerprintConfigured latch (a fprintd-list check failing across the restart turning fingerprint off for the lock session): real and pre-existing; left out of this PR since it predates it and warrants its own change, but noted.

#7179 still overlaps the retry path in Service.qml (the merge-tree conflict stands); the signals remain complementary and how they share the path is the maintainer's call. #7645 untouched.

@GeertJohan

Copy link
Copy Markdown
Contributor Author

@omarchybot I think #7179 or this PR can be rebased on top of the other, whichever lands first. Best to get either one merged as quick as possible (once all findings are addressed/resolved) such that the other PR can rebase.

mrlarsendk pushed a commit to mrlarsendk/omarchy that referenced this pull request Aug 27, 2026
Reconciles two independent passes over this file: a simplification
pass that removed the unused defensive paths (in-flight abort, the
20-attempt resume budget, PAM start() retry), and this session's
fixes for three bugs Copilot's review found on PR omacom#8531.

Net result: the PAM start() retry stays removed -- it matched pre-PR
baseline behavior and the added version was itself buggy and never
exercised. The in-flight abort is restored: it's the backstop for the
literal reported bug's mechanism (a check already running when sleep
lands), not incidental. The resume budget is restored but shrunk --
20 attempts/20s down to 3 attempts/5s, and now wall-clock bounded
rather than attempt-count-only, so a run of hung probes can't stretch
it past its advertised budget. A restart of the sleep-signal monitor
after an unexpected exit now treats a still-paused state as a resume,
instead of risking fingerprint staying disabled for the rest of the
session if a PrepareForSleep(false) was missed while the monitor was
down.

Signal-parsing and resume-budget arithmetic move into
SleepFingerprintModel.js (matching FingerprintModel.js's pattern from
omacom#7158), with a node-driven shell test covering both -- none of this
state machine had automated coverage before.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed the delta at 37b3b9b (Opus 5, with a second opinion from Codex at xhigh; its independence is not currently guaranteed, so where it only agreed with something already concluded that is said below). Ran on a disposable Omarchy VM with the compositor serving this branch, not read: lock-fingerprint-retry-test.sh (16), fprintd-resume-hook-test.sh (4), fprintd-resume-migration-test.sh (3), lock-fingerprint-indicator-test.sh, lock-blank-fingerprint-test.sh, fingerprint-invitation-test.sh, lock-stranded-recovery-test.sh, system-lock-test.sh — all green.

What you answered

(1) confirmed, the hook is byte-identical to what was pushed. (3) confirmed fixed at Service.qml:49, and the no-flicker claim holds for the reason you give: settleFingerprintAttempt zeroes the streak while fingerprintAttemptReachedDevice is still true, so the notice cannot blink back before the next startFingerprint() clears the flag. (2) and (5) read as described in the body. (4) is implemented, but the invariant it claims does not hold.

The notice itself is proven end to end for the case it was built for: the indicator fixture ran under a real compositor on the worker and asserts the notice appears, the glyph crosses out, the reserve holds, and both clear on recovery.

1. nudgeFingerprint respins the loop across attempts, not just within one [medium]

The guard at Service.qml:194 is interval <= MATCH_RETRY_MS, which is only true for the 250 ms of the collapsed wait. settleFingerprintAttempt (Service.qml:265) then puts the interval back to retryDelayMs(streak), so the guard reopens and the next input collapses it again. LockView.qml:120 emits wakeRequested() from onPositionChanged on a hoverEnabled MouseArea covering the whole surface — one per pointer motion event, not one per gesture.

Measured by lifting nudgeFingerprint and settleFingerprintAttempt verbatim out of Service.qml and driving them against a stand-in root, starting at streak 3 with the notice showing and attempts that fail instantly, over 10 s of lock screen:

pointer PAM attempts in 10 s
still 1
moving (125 Hz) 39

39 in 10 s is the ~4 sessions/second your own problem statement is about, and it is sustained rather than a burst: it also keeps fprintd from reaching the 30-second idle exit that FingerprintModel.js:11-14 names as the recovery path when the hook has not cleared the wedge. Typing is the milder version of the same thing, via LockView.qml:167.

#7179 has this function under the same name with a fingerprintNudgeCooldownMs: 2000 wall-clock floor, and the comment "the cooldown stops a moving cursor from spinning the loop back up". I have not pushed a fix, because how hard presence should override the backoff is the same question #7179 answers, and picking a shape here would prejudge that.

Codex raised the same point; independence is not guaranteed, so read it as agreement rather than confirmation. It did add that assigning to a running Timer's interval restarts the countdown on its own, so the restart() at :196 is redundant rather than wrong.

2. Nothing bounds a fingerprint attempt that never returns, and the hook is what makes that reachable [high]

fingerprintRetryTimer is repeat: false and is re-armed only by settleFingerprintAttempt() (Service.qml:266), which runs only from onError, onCompleted, or a failed start(). So an attempt that neither errors nor completes stops the whole machine: the streak never advances, fingerprintUnavailable never becomes true, and nudgeFingerprint() returns at both fingerprintPam.active (:192) and !fingerprintRetryTimer.running (:193). All three layers are blind to it and the icon keeps showing the normal glyph, inviting touches — the state LockView.qml:204 exists to prevent.

#8747, filed this morning, is the field report of that state. Same PAM stack, same lock plugin: restart the daemon under an active omarchy-lock-fingerprint session and pam_fprintd does not fail fast, it blocks on the dead call for ~25-30 s before erroring with ReleaseDevice failed: Client must claim device first, after which it works instantly. Their trigger was a third-party driver's own post-resume restart service. This PR makes that same restart stock.

And it fires on every suspend, not a rare one. omarchy-system-sleep-monitor runs omarchy-system-sleep-lock on PrepareForSleep(true) and waits for the lock to go secure; onSecureStateChanged calls startFingerprint(), which D-Bus-activates fprintd. So on a fingerprint laptop, fprintd is running and claimed at the moment of every lid-close suspend — which makes the hook comment's "try-restart is a no-op when fprintd is not running, which is the common case (nothing held the reader across the suspend)" backwards for exactly the flow this PR targets.

The case to rule out: in the wedge you set out to fix, attempts fail fast with Device was already claimed, the streak climbs and the notice fires, so the user is told. If instead the hook stops fprintd before the old process errors the verify, the session is orphaned and the user is told nothing for ~25-30 s. That trades a visible failure for an invisible one, which is the opposite of what layer three is for.

I could not reproduce it here — a worker has no reader and no useful suspend — so the ~25-30 s is #8747's measurement, not mine. The structural half (no settle, so no notice and no nudge) is from the source and holds whatever the duration turns out to be. Nothing pushed: the shapes on offer are a watchdog on the attempt itself, #8747's net.reactivated.Fprint NameOwnerChanged watcher, or #8531's PrepareForSleep pause, and choosing among those is yours and the maintainer's.

#7179, and two things that arrived since the last look

On your question about rebase order: that is the maintainer's call and I will not make it, but the comparison. The Service.qml merge conflict still stands, re-checked between 37b3b9b and #7179's 6aec521. This PR removes the wedge at its source — the only one of the three with a system-sleep hook and a migration — and is the only one that tells the user anything. #7179 covers strictly more of the retry path: the same presence nudge with the cooldown this one lacks, plus a duty-cycle model that releases the reader while the display is blanked, a case this PR does not touch and one its nudge works against, since a cursor move re-arms the reader with no blank gate. Neither is a superset — #7179 has no answer for a claim wedged by suspend, this one has none for thermal. Rebasing this onto that is the smaller job (63 changed lines in Service.qml against 130), but #7179 is still a draft, so "whichever lands first" currently means this one.

New since the last look: #8531 edits the same functions from a third direction, pausing the fprintd-list probe across the sleep boundary. Its body flags an unverified interaction with this PR — if PamContext.abort() raises onError, its pauseFingerprintForSleep() would advance your unreached streak on every ordinary suspend and eventually trip the notice from nothing but routine sleep. I did not verify whether abort() fires onError, so that stays flagged rather than confirmed. Three open PRs now edit startFingerprint, settleFingerprintAttempt and fingerprintRetryTimer.

Coverage

The delta ships no tests. lock-fingerprint-retry-test.sh covers FingerprintModel.js, which did not change, and the indicator fixture drives LockView.fingerprintUnavailable as an input, so neither the gate at :49 nor nudgeFingerprint has any. Extracting the real function bodies from Service.qml and running them against a stand-in root works here — it is how the table above was measured — and would pin both.

The fingerprintConfigured latch is unchanged and I am not re-raising it; reading it as pre-existing is fair, though it is the same "reader dead, nothing on screen" shape as finding 2, so whoever takes one may as well take the other.

Waiting on you for the nudge floor and for whether the orphaned-attempt case needs answering here, and on the maintainer for merge order across #7158, #7179 and #8531.

@GeertJohan

Copy link
Copy Markdown
Contributor Author

Both addressed at ba69b0a3.

  • (1) nudge respinning the loop: added a wall-clock cooldown. nudgeFingerprint now gates on FingerprintModel.shouldNudge(now, lastNudge, interval) — a wait longer than the fast interval, and at most one collapse per NUDGE_COOLDOWN_MS (2s). Driving the extracted shouldNudge at 125 Hz over 10s gives 6 collapses, not 39. (Kept the restart() — correct whether or not assigning interval restarts, so I left it unambiguous rather than relying on the implicit reset.)
  • (2) orphaned attempt: added a reach-timeout. startFingerprint arms fingerprintReachTimer (REACH_TIMEOUT_MS, 5s); a relayed prompt stops it, so a healthy reader waiting for a finger is untouched — it prompts in under a second. An attempt that gets no prompt in the window is stuck (a claim orphaned when the hook restarts fprintd under it), so timeoutFingerprintReach aborts and settles it unreached: the streak advances, the notice fires, and the retry hits the fresh daemon — bounding Lock screen fingerprint auth hangs ~25-30s if fprintd restarts while locked (e.g. after suspend on drivers needing a post-resume reset) #8747's ~25–30s to ~5s and making it visible instead of silent. It settles directly rather than through onError, so it doesn't depend on whether abort() raises one.

That last point also bears on #8531's flagged interaction: our abort→settle path is guarded and idempotent, so a stray onError from an abort folds in once and cannot advance the streak twice. Whether PamContext.abort() raises onError I did not confirm either.

Coverage: shouldNudge and the new constants are in FingerprintModel.js with Node assertions, including the moving-cursor case that would have caught (1). The reach-timeout wiring itself is QML-level and not extract-tested.

The Service.qml overlap with #7179/#8531 stands, but it doesn't need resolving up front — whichever of the three lands first, the others rebase onto it.

@GeertJohan
GeertJohan force-pushed the lock-fingerprint-recovery branch 2 times, most recently from 896d549 to bd8b129 Compare August 29, 2026 07:11
@GeertJohan

Copy link
Copy Markdown
Contributor Author

Rebased onto current quattro and curated to three commits.

  • Rebase picked up the new textFormat policy (qml-text-format-test.sh): the fingerprint icon and the unavailable notice now declare textFormat: Text.PlainText, and that test passes.
  • History collapsed from the review rounds into three atomic commits — the resume hook, the hook timeout bound (kept as its own commit, still authored by @omabot), and the pacing + unavailable notice. No behavior change from the last push; the tree is byte-identical.

Green here: lock-fingerprint-retry, lock-fingerprint-indicator, fprintd-resume-hook, fprintd-resume-migration, qml-text-format, and qmllint.

@GeertJohan
GeertJohan requested a balanced review from Copilot August 29, 2026 07:12

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@GeertJohan
GeertJohan requested a lite review from Copilot August 29, 2026 07:12
omarchybot added a commit to Only1allan/omarchy that referenced this pull request Oct 8, 2026
quattro added the typeof module guard to shell/plugins/lock/FingerprintModel.js (omacom#7158) and grew the guarded export blocks in ImagePickerModel.js, audio/Model.js, network/Model.js and IdleModel.js. Keep quattro's new functions and drop the guards, so no shell/ file references module. Every name the dropped blocks exported is a top-level declaration the test loader finds under the same name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
buger added a commit to probelabs/omarchy that referenced this pull request Oct 9, 2026
Owner decision (2026-10-09): these known issues are already public on
omacom/omarchy, so keeping them private hides nothing.

- KI-APPLY-LOCK-FPRINT-GATE-FAIL-OPEN (omacom#9551)
- KI-LOCK-FPRINT-PROBE-FAIL-OPEN (omacom#9551)
- KI-LOCK-SPONTANEOUS-UNLOCK-FAIL-OPEN (omacom#7072, omacom#10459)
- KI-MENU-JSONC-COMMA-IN-STRING (omacom#13250)

proof known-issue edit --set-disclosure public --append-note, then
proof evidence refresh per KI (the edit changed the record content hash).
Each reproducer re-ran and matched its earlier claim: the two fingerprint
KIs not reproduced (fixed by omacom#7158), spontaneous-unlock and JSONC comma
still reproduced. proof known-issue check --id on the 4 KIs: clean.
Engine 0.1.0-dev+g5c7b5e58084e.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
alanwcurry-dev added a commit to alanwcurry-dev/omarchy that referenced this pull request Oct 12, 2026
omacom#7158 paced the failures that never reach the reader, but an attempt that *does*
reach it and finds no finger is the healthy case there, so it keeps the fast
retry and the loop never ends: a press-type reader is re-armed every scan window
for as long as the machine stays locked. On the reference machine (FocalTech
FT9365, press sensor) three unattended nights produced 70, 1348 and 3680 lock-PAM
sessions, 2972 of them inside a single hour (omacom#9905), and the same endless re-arm
wedges T1Bridge readers until the machine is power cycled
(standardagents/t1bridge#14).

Bound the loop at the reader instead of slowing it:

- attempts that reached the reader are counted (UNATTENDED_BUDGET, 6), and the
  budget is terminal: the sensor pauses and stops being armed;
- deliberate input - a click, a tap or click in the password field, a keystroke,
  typing - hands it a fresh budget, rate-limited to one decision per cooldown so a
  typing run does not count as a new decision per keystroke, and it clears the
  count whether or not the sensor had paused, so a budget spent before the user
  came back cannot pause in front of them;
- a resume clears a pause: the machine comes back under someone who is about to
  touch the reader, and one budget per wake keeps the bound across a night of
  suspends;
- while paused the lock says so, below the field rather than inside it, because
  the field's single line elides the sentence and its error styling would read as
  a failed login on a lock that is only waiting.

An attempt that never reached the reader is unchanged: it keeps its backoff and
its unavailable notice, and keeps retrying, because that is how a reader that
comes back is found again.

The policy is unit-tested in test/shell.d/lock-fingerprint-retry-test.sh,
including an unattended reader that must stop after exactly the budget and an
unreached reader that must not.
alanwcurry-dev added a commit to alanwcurry-dev/omarchy that referenced this pull request Oct 12, 2026
omacom#7158 paced the failures that never reach the reader, but an attempt that *does*
reach it and finds no finger is the healthy case there, so it keeps the fast
retry and the loop never ends: a press-type reader is re-armed every scan window
for as long as the machine stays locked. On the reference machine (FocalTech
FT9365, press sensor) three unattended nights produced 70, 1348 and 3680 lock-PAM
sessions, 2972 of them inside a single hour (omacom#9905), and the same endless re-arm
wedges T1Bridge readers until the machine is power cycled
(standardagents/t1bridge#14).

Bound the loop at the reader instead of slowing it:

- attempts that reached the reader are counted (UNATTENDED_BUDGET, 6), and the
  budget is terminal: the sensor pauses and stops being armed;
- deliberate input - a click, a tap or click in the password field, a keystroke,
  typing - hands it a fresh budget, rate-limited to one decision per cooldown so a
  typing run does not count as a new decision per keystroke, and it clears the
  count whether or not the sensor had paused, so a budget spent before the user
  came back cannot pause in front of them;
- a resume clears a pause: the machine comes back under someone who is about to
  touch the reader, and one budget per wake keeps the bound across a night of
  suspends;
- while paused the lock says so, below the field rather than inside it, because
  the field's single line elides the sentence and its error styling would read as
  a failed login on a lock that is only waiting.

An attempt that never reached the reader is unchanged: it keeps its backoff and
its unavailable notice, and keeps retrying, because that is how a reader that
comes back is found again.

The policy is unit-tested in test/shell.d/lock-fingerprint-retry-test.sh,
including an unattended reader that must stop after exactly the budget and an
unreached reader that must not, and the lock service's own quickshell harness
(spends the budget and pauses) carries the same two cases.
omarchybot added a commit to anupanup2001/omarchy that referenced this pull request Oct 13, 2026
quattro's omacom#7158 replaced setup_lock_fingerprint_pam with a call to omarchy-apply-lock, next to where this branch adds setup_goodix_tod_driver. Keep the new function and drop the removed one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
niconistal added a commit to niconistal/omarchy that referenced this pull request Oct 14, 2026
Nobody can reach the sensor with the panel dark, yet the fingerprint PAM
stays armed and the retry timer re-arms it after every attempt for the
whole lock. Suspend the fingerprint when the lock blanks the display:
stop the retry and reach timers and drop an attempt already in flight
without counting it as a miss. Resume it on every route the panel comes
back by: runWake(), a screen set change, and a resume from sleep that
kept the same outputs and so never reached runWake(). The resume route
also re-arms the blank timer, so a dark wake blanks and suspends again.

The instant-failure backoff from the earlier revision is dropped; omacom#7158
landed its own.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
derekross added a commit to derekross/omamobile that referenced this pull request Oct 30, 2026
…is enrolled

Omarchy 4.0.6's lock and omarchy-apply-lock decide fingerprint is set up
with `fprintd-list "$USER" | grep -qi finger`, which also matches
"User ... has no fingers enrolled ...". omamobile-fingerprint installs
/etc/pam.d/omarchy-lock-fingerprint and pulls in fprintd, so on a phone
with nothing enrolled only that grep decides, and it says yes. The lock
then starts a pam_fprintd attempt that fails at once (PAM_AUTHINFO_UNAVAIL,
code 9) and retries 250 ms later for as long as it is up: 130,164 failed
attempts in one night on a Pixel 7 Pro, about 3.4 a second, each reaching
fprintd and polkit, and 55-62 mA (roughly 12 % of the phone's draw) in an
A/B run against the PAM file moved aside (#170).

Upstream fixed this in 879d6583d ("Fix fingerprint enrollment and
lock-screen recovery", omacom/omarchy#7158), which is only in the 4.5
pre-releases. Patch 0022 backports its probe half:

- the lock's probe becomes `LC_ALL=C fprintd-list "$USER" 2>&1`, read by
  FingerprintModel.classifyProbe(): yes only for an enrolled-print row
  (" - #0: ..."), no for "has no fingers enrolled" (or no PAM file),
  unknown otherwise; an unknown answer never turns fingerprint off and is
  asked again after 1 s, doubling to 40 s, while the lock is up;
- omarchy-apply-lock matches the same row, removes the fingerprint PAM
  file only on a definite no, and keeps it when the probe fails.

The rest of 879d6583d (the attempt backoff and "reader unavailable"
notice, the fprintd resume hook, the enrollment changes) is left out, so
a phone with a finger enrolled behaves as before: a mismatch still
retries at 250 ms. omamobile-fingerprint keeps owning the PAM file
(TOUCH-PLAN 0.1); with the probe fixed, the file's presence no longer
counts as setup on its own.

test/patches.py runs the patched lock's own probe command against a fake
fprintd-list with the issue's "has no fingers enrolled" text, an enrolled
print and a failed call, and puts the output through classifyProbe; it
runs the patched omarchy-apply-lock the same way. The series applies with
--fuzz=0 to the real aarch64 omarchy 4.0.6-1.

0.1.13 and 0.1.14 are taken by open #134 and #162 (and patch 0021 by

Fixes #170

Co-Authored-By: Claude Opus 5.5 <[email protected]>
derekross added a commit to derekross/omamobile that referenced this pull request Oct 30, 2026
…is enrolled (#171)

Omarchy 4.0.6's lock and omarchy-apply-lock decide fingerprint is set up
with `fprintd-list "$USER" | grep -qi finger`, which also matches
"User ... has no fingers enrolled ...". omamobile-fingerprint installs
/etc/pam.d/omarchy-lock-fingerprint and pulls in fprintd, so on a phone
with nothing enrolled only that grep decides, and it says yes. The lock
then starts a pam_fprintd attempt that fails at once (PAM_AUTHINFO_UNAVAIL,
code 9) and retries 250 ms later for as long as it is up: 130,164 failed
attempts in one night on a Pixel 7 Pro, about 3.4 a second, each reaching
fprintd and polkit, and 55-62 mA (roughly 12 % of the phone's draw) in an
A/B run against the PAM file moved aside (#170).

Upstream fixed this in 879d6583d ("Fix fingerprint enrollment and
lock-screen recovery", omacom/omarchy#7158), which is only in the 4.5
pre-releases. Patch 0022 backports its probe half:

- the lock's probe becomes `LC_ALL=C fprintd-list "$USER" 2>&1`, read by
  FingerprintModel.classifyProbe(): yes only for an enrolled-print row
  (" - #0: ..."), no for "has no fingers enrolled" (or no PAM file),
  unknown otherwise; an unknown answer never turns fingerprint off and is
  asked again after 1 s, doubling to 40 s, while the lock is up;
- omarchy-apply-lock matches the same row, removes the fingerprint PAM
  file only on a definite no, and keeps it when the probe fails.

The rest of 879d6583d (the attempt backoff and "reader unavailable"
notice, the fprintd resume hook, the enrollment changes) is left out, so
a phone with a finger enrolled behaves as before: a mismatch still
retries at 250 ms. omamobile-fingerprint keeps owning the PAM file
(TOUCH-PLAN 0.1); with the probe fixed, the file's presence no longer
counts as setup on its own.

test/patches.py runs the patched lock's own probe command against a fake
fprintd-list with the issue's "has no fingers enrolled" text, an enrolled
print and a failed call, and puts the output through classifyProbe; it
runs the patched omarchy-apply-lock the same way. The series applies with
--fuzz=0 to the real aarch64 omarchy 4.0.6-1.

0.1.13 and 0.1.14 are taken by open #134 and #162 (and patch 0021 by

Fixes #170

Co-authored-by: Claude Opus 5.5 <[email protected]>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…is enrolled (derekross#171)

Omarchy 4.0.6's lock and omarchy-apply-lock decide fingerprint is set up
with `fprintd-list "$USER" | grep -qi finger`, which also matches
"User ... has no fingers enrolled ...". omamobile-fingerprint installs
/etc/pam.d/omarchy-lock-fingerprint and pulls in fprintd, so on a phone
with nothing enrolled only that grep decides, and it says yes. The lock
then starts a pam_fprintd attempt that fails at once (PAM_AUTHINFO_UNAVAIL,
code 9) and retries 250 ms later for as long as it is up: 130,164 failed
attempts in one night on a Pixel 7 Pro, about 3.4 a second, each reaching
fprintd and polkit, and 55-62 mA (roughly 12 % of the phone's draw) in an
A/B run against the PAM file moved aside (derekross#170).

Upstream fixed this in 879d6583d ("Fix fingerprint enrollment and
lock-screen recovery", omacom/omarchy#7158), which is only in the 4.5
pre-releases. Patch 0022 backports its probe half:

- the lock's probe becomes `LC_ALL=C fprintd-list "$USER" 2>&1`, read by
  FingerprintModel.classifyProbe(): yes only for an enrolled-print row
  (" - #0: ..."), no for "has no fingers enrolled" (or no PAM file),
  unknown otherwise; an unknown answer never turns fingerprint off and is
  asked again after 1 s, doubling to 40 s, while the lock is up;
- omarchy-apply-lock matches the same row, removes the fingerprint PAM
  file only on a definite no, and keeps it when the probe fails.

The rest of 879d6583d (the attempt backoff and "reader unavailable"
notice, the fprintd resume hook, the enrollment changes) is left out, so
a phone with a finger enrolled behaves as before: a mismatch still
retries at 250 ms. omamobile-fingerprint keeps owning the PAM file
(TOUCH-PLAN 0.1); with the probe fixed, the file's presence no longer
counts as setup on its own.

test/patches.py runs the patched lock's own probe command against a fake
fprintd-list with the issue's "has no fingers enrolled" text, an enrolled
print and a failed call, and puts the output through classifyProbe; it
runs the patched omarchy-apply-lock the same way. The series applies with
--fuzz=0 to the real aarch64 omarchy 4.0.6-1.

0.1.13 and 0.1.14 are taken by open derekross#134 and derekross#162 (and patch 0021 by

Fixes derekross#170

Co-authored-by: Claude Opus 5.5 <[email protected]>
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