Repository navigation
Fix fingerprint enrollment and lock-screen recovery - #7158
Conversation
b26c201 to
edb63d5
Compare
|
Same signature here on a Framework 13 (AMD Ryzen AI 300), Omarchy 4.0.0-1, found while chasing an unrelated resume bug: 45 One data point that may be worth folding in: dropping a |
|
Reviewed against 1.
|
edb63d5 to
294e558
Compare
|
#7158 has been reworked. It is now three layers: a On the three findings:
This does touch The repeated- |
|
@omarchybot please re-review |
|
The PR description is updated to reflect the new implmentation. |
|
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: The four open findingsAll 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 1. The resume hook could hold the resume open — fixed, pushed as 07c9558
Your own sibling hook already knows this. 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 timeout 10s systemctl try-restart fprintd.service 2>/dev/null || true
Codex found this one, including the 2. A relayed prompt does not prove the reader works [medium, open]The predicate at #7176's journal is the case, on every one of 41,324 cycles:
3. The notice says "unavailable" while the reader is live [medium, open]
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 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 5. The restart drops another session's live verify [low]The description covers the abandoned claim. It does not cover a live one: a #7179 and #7645They conflict textually, confirmed rather than assumed: #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 clearThe One pre-existing thing this makes newly touchable, not a blocker: Waiting on you for 2, 3 and 4, and on the maintainer for how this and #7179 end up sharing the retry path. |
|
Findings 1, 3 and 4 are addressed; 2 and 5 are description fixes.
Description changes for the rest:
On the pre-existing #7179 still overlaps the retry path in |
|
@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. |
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]>
|
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: What you answered(1) confirmed, the hook is byte-identical to what was pushed. (3) confirmed fixed at 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.
|
| 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.
|
Both addressed at
That last point also bears on #8531's flagged interaction: our abort→settle path is guarded and idempotent, so a stray Coverage: The |
896d549 to
bd8b129
Compare
|
Rebased onto current
Green here: |
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]>
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]>
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.
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.
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]>
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]>
…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]>
…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]>
…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]>
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.