Repository navigation
Conversation
Fingerprint authentication used to fail silently and permanently if fprintd was not yet running when the session was locked. Since fprintd.service is D-Bus-activated, this is common right after boot or resume: GetDefaultDevice throws while the daemon is being activated, startVerify() returns without retrying and nothing ever restarts the chain. Claim and VerifyStart failures had the same problem (WARN log only). Retry the whole start chain (device proxy -> claim -> VerifyStart) up to MAX_START_RETRIES (3) times with auth:fingerprint:retry_delay between attempts, reusing the same addTimer() pattern as MATCH_NO_MATCH retries. After exhausting retries, enqueueFail() so the UI shows a proper "fingerprint unavailable" failure reason instead of a stuck prompt. startRetries is reset after a successful VerifyStart and when retries are exhausted, so the next lock/sleep cycle gets a fresh set of attempts. The device proxy is destroyed from a timer callback (not from within the D-Bus async reply handler) to avoid freeing an sdbus::IProxy whose code is on the call stack.
startVerify() retries reused auth:fingerprint:retry_delay (250 ms by default), giving ~750 ms total - shorter than the typical 1-3 s cold D-Bus activation window of fprintd after boot, i.e. the very scenario the fix targets. Have the start chain use its own backoff schedule (500 ms -> 1 s -> 2 s) instead, leaving retry_delay with its original no-match semantics. Also set done on give-up so the PropertiesChanged finger-present handler stops updating prompts after fingerprint auth is disabled.
MRAOFeb
force-pushed
the
fingerprint-start-verify-retry
branch
from
November 7, 2026 17:41
996c1b5 to
32dcb87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fingerprint authentication silently and permanently fails if fprintd is not yet running when the session is locked. Since
fprintd.serviceis D-Bus-activated (starts on first use, exits after ~30s idle), this is common right after boot/resume - exactly when users hit the lock screen.Previously
CFingerprint::startVerify()had three failure paths, and none of them retried:createDeviceProxy():GetDefaultDevicethrows while fprintd is being D-Bus-activated ->return, nothing restarts it;claimDevice()failure -> WARN log only;VerifyStartfailure on the initial call -> WARN log only.After any of these,
m_sDBUSState.verifyingstayedtrue, no verification was running, and the only recovery was re-locking the screen or suspend/resume.Changes
startVerify()chain (device proxy -> claim -> VerifyStart) with its own exponential backoff - 500 ms -> 1 s -> 2 s (up to 3 retries after the initial attempt, i.e. 4 attempts in total), sized to cover the typical 1-3 s cold D-Bus activation window offprintdafter boot. This keepsauth:fingerprint:retry_delay(semantically about no-match retries) untouched. Reuses the existingg_pHyprlock->addTimer()pattern plus a newSDBUSState::startRetriescounter and aMAX_START_RETRIES = 3constant.verifying = false, mark the D-Bus state as done (so thePropertiesChanged/finger-presenthandler stops updating the prompt after auth is disabled) and callg_pAuth->enqueueFail()with a descriptive failure reason ("Fingerprint auth disabled (fprintd unavailable)" / "(failed to claim device)" / "(failed to start verification)"), so the UI shows a proper fail state instead of a stuck prompt. Password auth is unaffected.startRetriesis reset after a successfulVerifyStartand when the retries are exhausted, so the next lock/sleep cycle gets a fresh set of attempts.isRetrypath (VerifyStart failure after a no-match retry: "Fingerprint auth disabled (failed to restart)") is preserved.sdbus::IProxywhose own callback code is on the call stack.Test plan
systemctl stop fprintd(or a fresh boot), lock immediately -> retries visible in verbose logs (fprint: couldn't connect to Fprint service, retrying...,could not start verifying, retrying...) at growing intervals (0.5 s -> 1 s -> 2 s); the fingerprint works as soon as fprintd comes up, since the retry window now spans ~3.5 s.$FPRINTFAIL), no hang, password auth unaffected.auth:fingerprint:retry_delay) untouched.AI usage disclosure: the PR description was AI-generated (my English is
weak, so I had it write up my change). The code itself is entirely mine.