From cc6ca1c969a7e6cb0d849001effe1dd158b0b5b0 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 3 Nov 2026 18:44:30 +0100 Subject: fix(git): stop SSH auth hanging after a closed screen lock prompt executeAfterAuthentication waited for another result whenever the prompt reported Failure, on the assumption that Failure meant a failed attempt with the prompt still open. Failure comes from error callbacks (lockout, timeout, unable to process), which always close the prompt, so the operation hung forever. Only Retry keeps the prompt open; every other result now ends the wait, and Failure and CanceledBySystem fail the operation with the generic screen lock error, like the other non-success results. Co-Authored-By: Claude Opus 5.5 --- .../java/app/passwordstore/util/git/operation/GitOperation.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt b/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt index 2d8b46ca..25d99d6d 100644 --- a/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt +++ b/app/src/main/java/app/passwordstore/util/git/operation/GitOperation.kt @@ -12,9 +12,7 @@ import app.passwordstore.data.repo.PasswordRepository import app.passwordstore.ui.main.MainActivity import app.passwordstore.ui.setup.SetupStart import app.passwordstore.util.auth.BiometricAuthenticator -import app.passwordstore.util.auth.BiometricAuthenticator.Result.CanceledBySystem import app.passwordstore.util.auth.BiometricAuthenticator.Result.CanceledByUser -import app.passwordstore.util.auth.BiometricAuthenticator.Result.Failure import app.passwordstore.util.auth.BiometricAuthenticator.Result.Retry import app.passwordstore.util.auth.BiometricAuthenticator.Result.Success import app.passwordstore.util.coroutines.DispatcherProvider @@ -163,7 +161,9 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) { callingActivity, R.string.biometric_prompt_title_ssh_auth, ) { result -> - if (result !is Failure && result !is Retry) cont.resume(result) + // Retry: a failed attempt while the prompt stays open. Every other result + // closes it, so waiting for more would leave the operation hanging. + if (result !is Retry) cont.resume(result) } } } @@ -174,10 +174,6 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) { is CanceledByUser -> { return Err(SSHException(DisconnectReason.AUTH_CANCELLED_BY_USER)) } - is Failure, - is CanceledBySystem -> { - throw IllegalStateException("Biometric authentication failures should be ignored") - } else -> { // There is a chance we succeed if the user recently confirmed // their screen lock. Doing so would have a potential to confuse -- cgit v1.2.3