Skip to content

Keep fingerprint unlock working across suspend - #8531

Closed
mrlarsendk wants to merge 3 commits into
omacom:quattrofrom
mrlarsendk:fingerprint-resume-after-sleep
Closed

mrlarsendk wants to merge 3 commits into
omacom:quattrofrom
mrlarsendk:fingerprint-resume-after-sleep

Conversation

@mrlarsendk

@mrlarsendk mrlarsendk commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Stock lock can drop fingerprint PAM across suspend. The lock's "is
fingerprint configured" probe (fprintd-list, in fingerprintCheckProc)
starts in the same window the sleep inhibitor releases and real suspend
begins — it D-Bus-activates fprintd if it isn't already running. fprintd
is then refused its own sleep-delay inhibitor, because the sleep
operation it would be inhibiting is already in flight
(org.freedesktop.login1.OperationInProgress), and so never sees
PrepareForSleep(false). On resume it answers before the reader has
actually recovered. On the reproducer hardware that's unsupported firmware version; the probe reports "no" instead of hanging,
fingerprintConfigured gets stuck false, and the lock never offers
fingerprint for that unlock. Same shape as #7229.

Nothing recovers from this on Arch. The fprintd package ships one
unit, fprintd.service; fprintd-resume.service is a Debian/Ubuntu
addition. An earlier version of this description claimed the daemon is
restarted at resume and the device recovers "too late" — that was wrong,
and my own fault: the unit I was seeing is one I hand-wrote on this
machine a year ago and had forgotten, owned by no package and not
shipped by Omarchy. Thanks to @MaxMad75 for catching it. On a stock box
a poisoned instance is never cleaned up: they observed the same PID
still refusing every request three days after activation, 65 already claimed refusals, never idle-exiting because each lock-screen retry
re-arms the idle timer. In the field the failure is not "one lost
unlock" — it persists until the user restarts fprintd by hand.

Not specific to s2idle. @MaxMad75 reproduced it with
mem_sleep=deep. The trigger is the logind inhibitor race inside the
sleep-delay window, which does not care which sleep mode follows.

Fix

Watch login1's PrepareForSleep signal directly (a dbus-monitor
process) and pause fingerprint checks across the sleep boundary:

  • Refuse to start a fresh probe once paused (refreshFingerprintStatus).
  • Drop the result of a probe that was already running when the pause
    landed, rather than trust an answer that may straddle suspend
    (abortFingerprintCheck).
  • On resume, re-probe on a 3-attempt / 5s wall-clock-bounded budget
    instead of trusting the first answer, since the reader can take a few
    seconds to recover.
  • Add an 8s timeout to the fprintd-list probe itself — a wedged reader
    can hang rather than fail outright.
  • If the sleep monitor exits having seen PrepareForSleep(true) but not
    (false), reconcile the still-paused state to "resumed" when it
    restarts, instead of leaving fingerprint disabled for the rest of the
    session.

Signal parsing and the resume-budget arithmetic live in
SleepFingerprintModel.js, covered by
test/shell.d/lock-sleep-fingerprint-model-test.sh. Every state
transition logs a fingerprint-* journal marker (restored in the
latest commit after I over-trimmed them from the original push — the
testing evidence below is stated in terms of those markers, and they
need to exist for anyone else to check it).

What this fix does not do

It stops the lock from being the thing that poisons fprintd inside the
sleep window. It does not make unlock succeed when the reader is
unavailable for any other reason, and the pre-existing failure path in
that case is bad: onError → 250ms fingerprintRetryTimer →
startFingerprint(), unbounded (#7176, #7172). @MaxMad75 hit exactly
that while testing this branch — see Testing — and I hit the same loop
via a polkit ReleaseDevice timeout with no suspend involved (94
failed PAM sessions, ~45 min degraded). A retry cap/backoff is
deliberately not in this PR: #7158's reachability-streak model is the
right shape for it, and widening this diff would collide with that
work. But it means this fix is necessary, not sufficient, on hardware
where the reader can stay claimed across resume.

Scope and relation to existing sleep/suspend handling

Two things worth a maintainer's eyes on merge order:

omarchy-system-sleep-monitor / omarchy-system-sleep-lock already
watch this signal.
That systemd service holds a
systemd-inhibit --what=sleep --mode=delay lock, runs its own
dbus-monitor on PrepareForSleep, and on true calls
omarchy-shell lock lock over IPC (what actually triggers
beginLock()), delaying real suspend until the session is secure. This
fix adds a second, independent dbus-monitor reacting to the same
signal rather than hooking into that pipeline. It's the simpler change,
and the bake evidence below shows it winning the race every time — but
it is a second consumer of a signal this codebase already has one
consumer for, and a maintainer may want it done through that pipeline
instead.

Open PR #7158 fixes a related but distinct bug — a fingerprint
verify (not this PR's configuration check) caught mid-flight by
suspend — and edits the same functions this PR does:
startFingerprint(), handleFingerprintFinished(),
fingerprintPam.onError, fingerprintRetryTimer, via a
reachability-streak/backoff model. Two interactions: (a) this PR's
pauseFingerprintForSleep() calls fingerprintPam.abort() when a
verify is active at sleep time; if PamContext.abort() fires onError
the way a real failure does, every ordinary suspend could advance
#7158's unreached-attempt streak and eventually trip its "reader
unavailable" notice from routine sleep. I haven't verified whether
abort() fires onError in Quickshell's PAM context — flagged, not
confirmed. (b) The retry-storm evidence above is a point in favor of
#7158's backoff, not just a collision risk. The two PRs should be
reconciled by whoever merges second.

Testing

52 sleep/resume cycles on a ThinkPad X1 Carbon Gen 9, Synaptics
Prometheus 06cb:00fc, s2idle, 2026-08-22 → 2026-08-29, including six
overnight lid-close → morning-wake cycles:

  • 51 logged resume probes, every one recovered
    fingerprintConfigured=true on its first attempt, ~1s after resume.
  • Zero unsupported firmware, zero fingerprint-configured=false,
    zero fingerprint-related password fallback on any resume.
  • The code changed once mid-bake, after review here: 41 of those
    resumes ran on the original 20-attempt/20s budget and 10 on the
    current 3-attempt/5s wall-clock-bounded one. Identical outcomes.

The "don't start a fresh probe while paused" guard
(fingerprint-check-skipped: sleep-paused) fired 42 times, and in
every instance the journal shows the same sequence:
PrepareForSleep(true) → lock-requested (the screen lock that would
have started the probe) → the probe blocked. The signal-to-lock margin
is 85–208ms, median 112ms, across all 42 — structural rather than a
hairline race, consistent with this watcher reading the D-Bus signal
directly while the existing pipeline pays for a script spawn and an IPC
round trip first. That makes it a direct interception of the bug's
trigger, not a correlation.

Independently, @MaxMad75 ran this branch on a Synaptics 06cb:00bd
under mem_sleep=deep (with their fprintd-resident workaround disabled
so it couldn't mask the race): two cycles, both with
fingerprint-paused-for-sleep → fingerprint-resume-pending →
fingerprint-configured=true firing correctly and on time. One
unlocked first-swipe ~2s after resume; the other still failed to
unlock because the reader stayed claimed after resume and the unbounded
retry loop described above took over (178 PAM sessions in 26s) — the
out-of-scope failure mode, with this PR's own state machine behaving
correctly through it.

What's not directly exercised: the in-flight-probe abort
(fingerprint-check-aborted: zero occurrences in the entire bake — the
guard above has always won the race first) and the resume re-probe
budget past its first attempt. Both are defensive for cases outside
what this machine's timing produces — slower D-Bus delivery, a reader
slower to recover, or hardware where the lock command wins the race
instead of the signal. Kept in rather than trimmed for that reason, and
noted here rather than presented as proven.

🤖 Prepared by Claude in Claude Code.

The lock's own "is fingerprint configured" probe (fprintd-list) can
start in the same window the sleep inhibitor releases, straddle the
actual suspend, and land on resume before fprintd has recovered. On
the affected hardware this reads as "unsupported firmware version":
the probe reports "no" rather than hanging, fingerprintConfigured
gets stuck false, and the lock never offers fingerprint for that
unlock. The only recovery is fprintd-resume.service, on its own
schedule, well after this lock screen already decided.

Watch login1's PrepareForSleep signal directly and pause fingerprint
checks across the sleep boundary: refuse to start a fresh probe once
paused, drop the result of one already running, and re-probe on a
budget after resume instead of trusting the first answer. Also add a
timeout to the fprintd-list probe itself and retry once if starting
the fingerprint PAM context fails, since a wedged reader can hang the
check instead of failing it outright.

Tested on a ThinkPad X1 Carbon Gen 9 with a Synaptics Prometheus USB
reader (06cb:00fc) under s2idle -- the race is generic to the sleep
lifecycle, not specific to this reader. See the PR description for
bake numbers and for what's directly confirmed versus defensive.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 27, 2026 04:47

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

Improves fingerprint unlock reliability across s2idle suspend by pausing probes during sleep and retrying after resume.

Changes:

  • Monitors login1 sleep signals.
  • Aborts stale fingerprint probes and authentication.
  • Adds post-resume retries and probe timeouts.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Suppressed comments (1)

shell/plugins/lock/Service.qml:429

  • This does not enforce the PR's 20-second resume budget: the timer waits one second before each probe, and each probe can then consume the new 8-second timeout. Twenty hung probes therefore take about 180 seconds before fingerprintConfigured is finally updated to false. Use a wall-clock deadline (and cap each probe to its remaining time), or reduce the attempt count/timeout so the advertised budget is actually bounded.
  Timer {
    id: fingerprintResumeTimer
    interval: 1000
    repeat: false
    onTriggered: {
      if (root.fingerprintResumeAttempts > 0) root.fingerprintResumeAttempts -= 1
      root.refreshFingerprintStatus()
    }

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

Comment thread shell/plugins/lock/Service.qml Outdated
Comment on lines +219 to +221
if (!fingerprintPam.start()) {
fingerprintAuthenticating = false
fingerprintRetryTimer.restart()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the retry entirely rather than bounding it — it matched pre-PR baseline behavior and wasn't needed to fix the reported bug. Fixed in 18f4b02.

Comment thread shell/plugins/lock/Service.qml Outdated
Comment on lines +442 to +449
onExited: fingerprintSleepMonitorRestart.restart()
}

Timer {
id: fingerprintSleepMonitorRestart
interval: 2000
repeat: false
onTriggered: if (!fingerprintSleepMonitor.running) fingerprintSleepMonitor.running = true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed and fixed in 18f4b02 — on an unexpected monitor restart, if still paused, it's now treated as a resume. Erring that way is safe: a genuinely-too-early probe just falls into the existing resume re-probe budget, whereas staying paused on a wrong guess disables fingerprint for the rest of the session.

Comment thread shell/plugins/lock/Service.qml Outdated
Comment on lines +273 to +277
function handleSleepMonitorLine(data) {
var line = String(data || "")
if (line.indexOf("member=PrepareForSleep") !== -1) {
awaitingSleepSignalValue = true
return

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Extracted the parsing and budget arithmetic into SleepFingerprintModel.js and added test/shell.d/lock-sleep-fingerprint-model-test.sh (11 assertions) covering both, in 18f4b02. The Process/dbus-monitor wiring itself isn't unit-tested, consistent with how the rest of this file's Process-driven behavior is tested elsewhere in the repo.

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 <noreply@anthropic.com>
@mrlarsendk

Copy link
Copy Markdown
Contributor Author

Thanks for the review — addressed all four points in 18f4b02 (replies on each inline thread). The resume budget (flagged in a suppressed comment on the timer) is now wall-clock bounded via a deadline checked alongside the attempt count, not just attempt-counted, so hung probes can't stretch it past its advertised budget. Also shrunk the budget itself from 20 attempts/20s to 3 attempts/5s — the larger number was never exercised in the bake and wasn't earning its complexity.

@MaxMad75

Copy link
Copy Markdown
Contributor

Confirming this on a second Synaptics Prometheus machine, with two details that may be worth folding into the PR: it is not limited to s2idle, and the recovery your description relies on does not exist on Arch.

System

  • Omarchy 4.0.1-1, kernel 7.1.9-arch1-2, quickshell 0.3.1-1
  • fprintd 1.94.5-2 / libfprint 1.94.100-1
  • Synaptics Prometheus MIS Touch 06cb:00bd
  • /sys/power/mem_sleep = s2idle [deep] — deep is the selected mode here, not s2idle

The last point matters for the title: the trigger is the logind inhibitor race inside the sleep-delay window, so it reproduces on S3 as well. Nothing about it is specific to s2idle.

The activation

19:07:29  NetworkManager: sleep: sleep requested (sleeping: no  enabled: yes)
19:07:30  omarchy-shell: omarchy lock ... lock-requested
19:07:30  systemd[1]: Starting Fingerprint Authentication Daemon...
19:07:30  fprintd[24160]: Failed to install a sleep delay inhibitor: GDBus.Error:
          org.freedesktop.login1.OperationInProgress: The operation inhibition has
          been requested for is already running

Same shape as #7229: the lock appears inside the delay window and D-Bus-activates fprintd while the sleep operation is already in flight, so fprintd is refused its own inhibitor and never sees PrepareForSleep(false).

What is different on Arch

Your problem statement says:

fprintd-resume.service restarts fprintd and the device recovers, but only after this lock screen already decided against it.

That unit is not part of Arch's fprintd. The package ships exactly one:

$ pacman -Ql fprintd | grep '\.service'
fprintd /usr/lib/systemd/system/fprintd.service
fprintd /usr/share/dbus-1/system-services/net.reactivated.Fprint.service

fprintd-resume.service is a Debian/Ubuntu addition. On Arch — which is what Omarchy is — there is no resume-time restart at all, so a poisoned instance is never cleaned up by anything.

The consequence is a change in kind, not degree. Where your reproducer loses one unlock and then recovers, here the daemon activated at 19:07:30 on Aug 25 was still the running PID three days later, refusing every attempt in between:

$ ps -o lstart= -p 24160
Tue Aug 25 19:07:29 2026
$ journalctl --no-pager | grep -c 'already claimed'
65

It never idle-exited either — the idle timer barely advances across suspend, and each new lock-screen retry re-arms it.

None of this argues against the fix; pausing the probe across the sleep boundary is the right place to stop the bad activation. It does mean that on the target platform there is no second line of defence behind it, so any path that still manages to activate fprintd inside the window stays broken until the user notices and restarts the daemon by hand. If that is a concern, ExecStart=/usr/lib/fprintd --no-timeout plus an [Install] section keeps the daemon resident and moves its inhibitor installation to boot, which sidesteps the race independently of the lock's timing. Happy to test the branch here if a second reader model is useful to you.

@MaxMad75

Copy link
Copy Markdown
Contributor

Following up on the --no-timeout suggestion from my previous comment — it holds up in practice here, so it is no longer just a theory.

Drop-in on the same box (Synaptics 06cb:00bd, mem_sleep=deep):

[Service]
ExecStart=
ExecStart=/usr/lib/fprintd --no-timeout

[Install]
WantedBy=multi-user.target

Across a real suspend cycle:

17:24:05  systemd[1]: Reached target Sleep.
17:24:43  systemd[1]: systemd-suspend.service: Deactivated successfully.
  • same MainPID before and after (115096)
  • systemd-inhibit --list still shows net.reactivated.Fprint … sleep … delay on the far side
  • zero already claimed / sleep delay inhibitor lines since the change
  • fingerprint unlock on the lock screen worked on the first try after resume

Before the drop-in, the instance activated by the lock died after ~33 s of idle and the next one was activated inside the sleep window again; keeping it resident means the inhibitor is installed at boot and simply never has to be negotiated mid-transition.

One wrinkle worth knowing for anyone applying this as a stopgap: the instance that happens to be running when daemon-reload lands does not pick up the new ExecStart. It still exits on the idle timer, and the unit then sits inactive until something activates it. A systemctl restart fprintd after the reload is required; ps -o cmdline= -p $(systemctl show -p MainPID --value fprintd) is the quick way to tell which one you have.

This is complementary to your change rather than an alternative — yours stops the lock from activating fprintd inside the window, this stops the window from mattering if some other path ever does.

@mrlarsendk

Copy link
Copy Markdown
Contributor Author

@MaxMad75 — thank you for this. A second machine, a different reader, and a different sleep mode is exactly what this change needed, and you found two things I had wrong. Yes please to testing the branch; details at the bottom.

You're right about fprintd-resume.service, and it's worse than a wording slip on my side. I went looking after your comment:

$ pacman -Qo /etc/systemd/system/fprintd-resume.service
error: No package owns /etc/systemd/system/fprintd-resume.service
$ stat -c '%y' /etc/systemd/system/fprintd-resume.service
2025-09-02 06:02:14

It is a unit I hand-wrote a year ago and forgot about. It is not in Arch's fprintd, and grep -rn fprintd-resume /usr/share/omarchy/ finds nothing, so it is not Omarchy's either. The "and the device recovers" clause in my problem statement describes my own local config, not the platform this targets. Your instance still holding the same PID three days later with 65 already claimed refusals is the accurate picture of what a stock user hits. That makes this fix more load-bearing than I described it, not less, and I will rewrite that paragraph accordingly.

Also right about s2idle. My machine reports [s2idle] only, so that framing came from my reproducer rather than from the mechanism. Since yours reproduces on deep, the logind inhibitor race is the correct level to pitch this at. I will retitle the PR and drop s2idle from the problem and scope language, keeping it only where I am describing my own test cycles.

On --no-timeout: I agree with your framing — complementary, different layer. This PR stops the lock from being the thing that activates fprintd inside the delay window; keeping the daemon resident stops the window from mattering when some other path trips it. That is a unit/packaging change rather than a lock-plugin one, so I do not think it belongs in this diff, but it deserves its own issue and I am happy to open one crediting your testing if you have not already. The daemon-reload wrinkle you documented — the running instance keeping the old ExecStart until an explicit systemctl restart fprintd — is exactly the detail that gets lost otherwise.

On testing the branch: yes, please. It would fill a gap I flagged in the PR. Two of the defensive paths have never once fired here, because the "refuse to start a new probe while paused" guard always wins the race first — 33 out of 33 closes, by a consistent ~100-130ms. Your box differs in the two ways that could move that margin: a different reader, and deep instead of s2idle.

One thing before you pull. The branch moved after a review pass and the PR body above still describes the original version. As of 18f4b02a:

  • the resume re-probe budget is 3 attempts / 5s, wall-clock bounded — not 20/20s, so fingerprint-resume-check attempts= counts down from 3
  • the PAM start() retry is gone
  • an unexpected sleep-monitor restart now reconciles a still-paused state to "resumed" rather than leaving fingerprint disabled for the session
  • signal parsing and budget arithmetic moved to SleepFingerprintModel.js, covered by test/shell.d/lock-sleep-fingerprint-model-test.sh

I am refreshing the body to match, along with the two corrections above.

What would be most useful from a run on your hardware:

  • whether fingerprint-check-aborted appears at all — an in-flight probe caught by the pause. Zero occurrences here, ever.
  • whether fingerprint-resume-check attempts= ever drops below 3, meaning the re-probe genuinely needed a second pass.
  • and the plain question: does a deep suspend/resume unlock on the first swipe.
journalctl -o short-iso | rg 'omarchy lock .*fingerprint-|Authenticated successfully|already claimed'

Either outcome is worth having — the guard simply holding on unfamiliar hardware is evidence too. And thank you for the #7229 pointer; same shape, and worth linking these together.

@MaxMad75

Copy link
Copy Markdown
Contributor

Thanks for digging into the fprintd-resume.service question rather than taking my word for it — a hand-written unit you'd forgotten is a better answer than either of us would have guessed.

Before the branch test, a correction to my own suggestion from yesterday. --no-timeout is not the complete answer I implied it was. It failed here this morning, in a new way, and the mechanism is worth having on record because anyone reading that comment will otherwise reach for it as a fix.

What happened

The fingerprint stopped working again overnight. The daemon was healthy by every measure I had proposed as the test:

$ systemctl show fprintd -p MainPID -p ActiveEnterTimestamp --value
115096
Fri 2026-08-28 17:19:26 CEST          # ~16 hours old, never exited

$ ps -o cmdline= -p 115096
/usr/lib/fprintd --no-timeout

$ systemd-inhibit --list | grep -i fprint
net.reactivated.Fprint  0  root  115096  fprintd  sleep  Suspend fingerprint readers  delay

Resident, correct flags, inhibitor installed and held across every suspend. And yet:

$ fprintd-list "$USER"
No devices available

The reader itself was fine — but re-addressed:

$ lsusb | grep 06cb
Bus 001 Device 010: ID 06cb:00bd Synaptics, Inc. Prometheus MIS Touch Fingerprint Reader
                # 008 yesterday, 010 today

A systemctl restart fprintd — same unit, same --no-timeout — brings it straight back:

$ ps -o cmdline= -p 215976
/usr/lib/fprintd --no-timeout
$ fprintd-list "$USER"
Fingerprints for user maxmad on Synaptics Sensors (press):
 - #0: right-index-finger

Two daemons, identical flags, identical inhibitor state. The only difference is age.

Why this matters for the framing

Keeping the daemon resident closes the inhibitor race, and it did: zero already claimed and zero inhibitor refusals in sixteen hours across several suspends, where before it was 65 refusals over three days. But a daemon that never exits never re-probes USB, and the reader is re-enumerated across suspend cycles on this hardware. So the workaround trades a poisoned-daemon failure for a stale-device-handle one, and the second is quieter — nothing in journalctl -u fprintd at all, just an empty device list.

That is a different layer from what your PR addresses, and it does not argue against either change. It does mean --no-timeout should not be presented as a standalone fix if you open that separate issue; on its own it needs a resume-time re-probe or restart beside it, which is roughly what your forgotten unit was doing for you.

On the branch test

Yes, and now with a wrinkle worth flagging for anyone else you ask: the drop-in masks exactly what you want tested. With fprintd resident, the lock screen never D-Bus-activates it inside the delay window, so the race your defensive paths guard against cannot arise. I will disable the drop-in first so the test measures your change rather than my workaround, then pull 18f4b02a and report on the three questions — fingerprint-check-aborted, whether attempts= drops below 3, and whether a deep resume unlocks on the first swipe.

@MaxMad75

Copy link
Copy Markdown
Contributor

Tested 18f4b02a on the Synaptics 06cb:00bd box, mem_sleep=deep, with my --no-timeout drop-in disabled first so it could not mask the race. Two suspend/resume cycles, three minutes apart. The first was clean, the second was not, and the difference is instructive: your change did its job both times.

Cycle 1 — worked

08:04:21.123  omarchy lock  fingerprint-paused-for-sleep
08:04:43.564  omarchy lock  fingerprint-resume-pending
08:04:44.614  omarchy lock  fingerprint-configured=true
08:04:45.919  omarchy lock  unlocked

Unlocked on the first swipe, ~2s after resume. Zero already claimed in the whole cycle.

Cycle 2 — pause and resume fired correctly, then it fell apart downstream

08:05:10.260  omarchy lock  fingerprint-paused-for-sleep
08:05:33.383  omarchy lock  fingerprint-resume-pending
08:05:34.434  omarchy lock  fingerprint-configured=true

Then, between 10:05:34 and 10:06:00 — twenty-six seconds:

  • 178 Starting pam session ... "omarchy-lock-fingerprint"
  • 88 Authorization denied ... 'Claim' ... Device was already claimed
  • every attempt ending Error while authenticating: "Authentication service cannot retrieve authentication info" (code 9)

No unlock. The screen went black after about ten seconds with the finger held on the reader; the machine had to be unlocked by password. That is roughly seven PAM sessions per second against a device that was never going to answer.

This is not your change failing. Both of your signals fired, in order, on time. The reader was simply still claimed after resume, and what turned an unavailable reader into a black screen was the retry loop — #7176 / #7172, amplified exactly as the second commenter on #7229 described. If anything this is more evidence that the retry cap belongs with this work.

The three questions, and a problem with two of them

whether fingerprint-check-aborted appears at all
whether fingerprint-resume-check attempts= ever drops below 3

Neither string exists in 18f4b02a. The only fingerprint lines the branch emits are:

$ grep -oE '"fingerprint[^"]*"' Service.qml | sort -u
"fingerprint-configured=false"
"fingerprint-configured=true"
"fingerprint-paused-for-sleep"
"fingerprint-resume-pending"

fingerprintCheckAborted is a real property and is set at Service.qml:237, but it is never logged, and there is no attempt counter in the output at all. So "zero occurrences here, ever" may not mean the path never fires — it may mean neither of us can see it. Worth adding a line at the point where the flag is set, and one carrying the remaining budget, before asking anyone else to test for them.

does a deep suspend/resume unlock on the first swipe

Once out of twice. deep is not the discriminator by itself — the same machine, the same mode, three minutes apart, went both ways.

One more thing, about my own suggestion

My --no-timeout advice from yesterday is incomplete and I have said so on the PR already, but it belongs here too if you open that separate issue: keeping fprintd resident does close the inhibitor race — sixteen hours and several suspends with zero refusals — but a daemon that never exits never re-probes USB, and this reader is re-enumerated across suspend (Device 008 → 010 overnight). It ended up reporting No devices available with a perfectly healthy inhibitor. It needs a resume-time re-probe beside it, which is roughly what your forgotten unit was doing.

Happy to run more cycles, or to test again once there is something logged at the two points above — that would make a repeat run actually answer your questions rather than mine.

The bake evidence in the PR description (guard fires, resume attempt
counts, zero in-flight aborts) comes from logEvent markers that were
trimmed out of this branch as diagnostic noise when the PR was
prepared — so nobody running the branch could reproduce or extend it,
as MaxMad75 found while testing. Restore the five markers with the
exact wording the evidence was gathered under:

- fingerprint-check-skipped: sleep-paused
- fingerprint-check-aborted
- fingerprint-check-ignored: sleep-paused
- fingerprint-resume-check attempts=N
- fingerprint-not-ready attempts=N

No behavior change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PYLaEtN71fd5LUFzadhKam
@mrlarsendk mrlarsendk changed the title Keep fingerprint unlock working across s2idle suspend Keep fingerprint unlock working across suspend Aug 29, 2026
@mrlarsendk

Copy link
Copy Markdown
Contributor Author

@MaxMad75 — you're right, and thank you for burning a test cycle to find it. The markers were in the plugin that produced the bake numbers (my daily-driver copy of this code) and I trimmed them out of the branch as diagnostic noise when preparing the PR. The fix logic was identical; the evidence was not reproducible. Restored in 9cade54 — all five markers, exact wording: fingerprint-check-skipped: sleep-paused, fingerprint-check-aborted, fingerprint-check-ignored: sleep-paused, fingerprint-resume-check attempts=N, fingerprint-not-ready attempts=N. No behavior change.

One clarification on "zero occurrences may mean neither of us can see it": the daily driver does log fingerprint-check-aborted, and the journal has zero hits across all 52 cycles — that claim stands. What didn't stand was asking anyone on the branch to verify it. Now they can.

On cycle 2: your analysis matches mine exactly. Both signals firing correctly while the user still ends at a black screen means this fix is necessary, not sufficient — the unbounded 250ms retry (#7176, #7172) turns any still-claimed reader into your 178-sessions-in-26s. I hit the same loop the day before you did, with no suspend involved (a polkit ReleaseDevice timeout leaked the claim; 94 failed sessions). I'm deliberately not adding a retry cap here: #7158's backoff model is the right home for it, and widening this diff would collide with that work. The description now says all of this instead of implying the fix delivers an unlock unconditionally.

Noted on --no-timeout — a resident daemon never re-probing a re-enumerated USB device is exactly the kind of quiet failure that would have spread from your earlier comment. If the separate issue gets opened, your retraction goes in it alongside the original result.

If you're still willing after two cycles of my homework: same three questions as before, but they're answerable now. Description and title updated to match (suspend generally, not s2idle; no phantom resume unit; current budget).

@MaxMad75

Copy link
Copy Markdown
Contributor

Opened #8935 for the stale-device half we discussed — the resident-daemon side, so it does not land in your diff. It restarts fprintd after the sleep targets rather than shipping a system-sleep hook; I tried the hook first and on systemd 261 /etc/systemd/system-sleep/ is not read at all, only the /usr/lib path the man page documents. Effectively the same job your forgotten unit was doing, with the reasoning written down this time. Credit for pointing at it is yours.

@mrlarsendk

Copy link
Copy Markdown
Contributor Author

Ultimately i dont care wether it is me or someone else who figures out the perfect solution. What matters is that we make the collective experience better:-) thanks for you envolvement.

@MaxMad75

Copy link
Copy Markdown
Contributor

@mrlarsendk — agreed, and thanks for taking the corrections in the spirit they were meant.

A short status from this end, since the picture got clearer over the last day. What I called one bug turns out to be three, and yours is the first of them:

  1. The inhibitor race — activation inside logind's sleep-delay window. That is this PR.
  2. The stale device handle — the daemon survives a USB re-enumeration that libfprint never learns about. @xe-nvdk caught it at kernel level on a second reader while testing Restart fprintd after resume so it re-enumerates the reader #8935 (USB disconnect → New USB device found → unsupported firmware version → No such device [-4]); a third reader shows it in Recover stale fprintd after suspend #8818. Three Synaptics variants, s2idle and deep.
  3. The retry storm afterwards — once the reader cannot answer, the lock screen retries roughly four times a second with nothing shown to the user. On my machine that was 178 PAM sessions and 88 already claimed in 26 seconds, ending in a black screen. Neither your PR nor mine touches it; Fix fingerprint enrollment and lock-screen recovery #7158 does, and I am testing it here now.

So the collective experience you are after probably needs (1) and (3) together — the wedge removed and the aftermath made survivable. Good luck with this one.

@mrlarsendk

Copy link
Copy Markdown
Contributor Author

@xe-nvdk — same laptop model and same reader here (X1 Carbon Gen 9, Synaptics 06cb:00fc, s2idle; mine 20XW005NMX / kernel 7.1.11-arch1-1, yours 20XW003GUS / 7.1.9-arch1-2), but the kernel does something different, so bug (2) may not be universal even on this reader.

No re-enumeration here. Ever. Across the full journal: USB disconnect 0 occurrences; usb 3-3: reset full-speed USB device number N using xhci_hcd 28 times, device number stable within a boot.

The original failure this PR was written from:

07:33:13  kernel:   printk: Suspending console(s)
07:33:13  fprintd:  Ignoring device due to initialization error: unsupported firmware version
07:33:13  kernel:   usb 3-3: reset full-speed USB device number 24 using xhci_hcd
07:33:13  kernel:   PM: suspend exit

Reset, not disconnect — and the probe lands inside that window, in the same second as suspend exit. unsupported firmware version has occurred 3 times total on this machine.

On No such device [-4]: I have ~60, but spread over a year at roughly one every few days, and none since 2026-08-18 — none during the 53-cycle bake. libfprint prints "it may have been disconnected" for any USB error, so those aren't disconnect evidence on their own; my kernel logged none.

So the same error string is reachable two ways: a USB reset the probe races (here) and a full re-enumeration leaving a stale handle (yours). #8531 targets the first. Worth knowing before the fix for (2) is scoped as applying to all 06cb:00fc.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 9cade544 against quattro. The review was by Claude Opus 5.5 alone: the second opinion (Codex Medium) was reachable but did not run, because its daily review budget was spent, so nothing here has been checked by a second model. Nothing was run either. No worker has a fingerprint reader, and for the reason below this pull request was compared with its competitor rather than tested.

The diagnosis holds, and it traces through the source: omarchy-system-sleep-monitor locks from inside its own sleep-delay inhibitor, and beginLock then runs fprintd-list (and, once the session is secure, pam_fprintd) inside that window. That is the mechanism in #7229.

#9919 fixes the same trigger the same way: a lifetime dbus-monitor on PrepareForSleep that holds fingerprint checks and scans until resume. I am recommending #9919 to the maintainer over this one, for three reasons:

  • It is the proportionate version. It adds one gate and one monitor to Service.qml (+130/-1). This pull request adds the same gate plus a resume re-probe budget, an 8s probe timeout, dropping a probe that is already in flight, and a separate JS model (+264/-10). By your own account, neither the in-flight abort nor the re-probe beyond its first attempt ever fired across 52 cycles.
  • It leaves a running scan alone at suspend. pauseFingerprintForSleep (Service.qml:249) calls fingerprintPam.abort() on an active verify. Hold fingerprint checks on the lock screen until resume #9919's author reports that an earlier revision of theirs did exactly this, and that it made fprintd close the reader in the middle of the transition. After a long sleep the reader woke with stale firmware state and failed every scan until the daemon exited. I have not reproduced that, but it is a specific, logged failure against the one behaviour where the two pull requests differ, and nothing here shows the abort is needed.
  • It has been confirmed on hardware its author does not own, at its current head: a Synaptics 06cb:0106 on an HP EliteBook, two lid cycles, unlocked by fingerprint both times with fprintd not activated during sleep entry.

There is one thing this pull request does that #9919 does not. On resume it always re-runs the availability check. #9919 re-runs it only if one was held back, so a check that already answered "no" before PrepareForSleep(true) (a lid-close lock can arrive before the signal) still leaves that lock password-only. If the maintainer takes #9919, that gap is worth closing there. It needs a line or two, not this pull request's machinery.

The rest of the evidence you and @MaxMad75 collected is valuable in its own right, especially the split into three failures: the inhibitor race, the stale device handle, and the retry storm in #7172/#7176. That split is the clearest map of this area in any thread.

Waiting on the maintainer to choose between this and #9919. Only one of them should land.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this, @mrlarsendk. #9919 fixes the same problem in a way the review judged better, so this is closed in favour of it. If it does not cover your case, please say so there.

Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent.

@omarchybot omarchybot closed this Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The post-resume recovery and transient-probe failure are now addressed by merged #7158. #9919 remains open for its separate pre-suspend deferral mechanism; this alternative remains closed.

GPT-6 in Codex and Claude Opus 5.5 Medium checked the coverage against the landed source; Claude's agreement does not guarantee independence. This closure review was read-only and did not rerun runtime tests.

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.

5 participants