Repository navigation
fingerprint: rebuild device proxy and re-claim after waking from sleep - #1049
PixelHegel wants to merge 1 commit into
Conversation
On resume the handler called startVerify() on the pre-sleep device proxy, which goes straight to VerifyStart. That only works if fprintd kept both the device object and our claim across sleep. Readers that power down during sleep re-enumerate on resume (e.g. Synaptics Prometheus 06cb:00fc), which tears down fprintd's device object — and wedges fprintd badly enough that restarting it is the only recovery, at which point the claim is gone too. VerifyStart then fails with "Device was not claimed before use" and fingerprint auth stays dead until hyprlock itself restarts. Instead, treat post-sleep state as untrustworthy: stop verification and release whatever claim we held (both already swallow errors, which is exactly right when the daemon was restarted), drop the proxy, and let startVerify() take its existing cold-start path — re-query the default device, re-subscribe the signals, claim, verify. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
I've been seeing the same issue on my thinkpad and debugging with Claude. Does this actually fully resolve the issue for you? What about when you close the lid for more than 20 minutes? My claude developed a fix that is a "superset" of this one that addresses longer lid closes in a way this does not:
|
|
Also I've noticed no engagement with this PR from any maintainers. Is it just people being focused on other things or is it just the lack of non-AI contribution to the code or request comments keeping everyone from taking it seriously? In other words, do y'all need me to put some more legwork into understanding the claude generated fix and properly endorsing/explaining it, or can we all just agree, if I say a fix fixes it for me, then let's get it merged. The above fix doesn't fix it for me but I have a fix that was similarly generate by claude that does. |
|
#1066 Has the retry logic that is needed and included in my fix. I'll work on submitting my own pull request. |
On machines where the fingerprint reader powers down during suspend (Synaptics Prometheus 06cb:00fc here, but any reader that re-enumerates on resume), fprintd's device object doesn't survive sleep. The claim hyprlock took before suspending is gone when the machine wakes up — and if a verify was still in flight when the system went down, fprintd can wedge badly enough that a restart is the only way to recover it, which also kills the claim.
The wake side of the
PrepareForSleephandler currently just callsstartVerify(), which sees the old device proxy and goes straight toVerifyStart. That fails withDevice was not claimed before use, we log a warning, and that's the end of it — fingerprint auth is dead until hyprlock itself restarts. In practice: lock, close the lid, open it, and only the password works.This treats post-sleep state as stale instead. On wake we stop verification and release whatever claim we held (both helpers already swallow errors, which is exactly what we want when the daemon was restarted underneath us), drop the proxy, and let
startVerify()take its existing cold-start path:GetDefaultDevice, resubscribe the signals, claim, verify.The release-before-reclaim order keeps readers that do survive suspend working: there the release succeeds and we simply claim again.
Tested on Arch (fprintd 1.94.5, libfprint 1.94.10) with the Prometheus sensor: fingerprint used to be dead after every single lid-close cycle, and comes back reliably with this patch.
🤖 Generated with Claude Code