PM-19399: Do not show 'Share error details' button when user enter incorrect password (#4905)

This commit is contained in:
David Perez 2025-03-21 11:29:38 -05:00 committed by GitHub
parent 21af60f4de
commit 94a91702cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 14 deletions

View File

@ -343,7 +343,7 @@ class VaultUnlockViewModel @Inject constructor(
} else {
state.vaultUnlockType.unlockScreenErrorMessage
},
throwable = result.error,
throwable = result.error?.takeIf { _ -> action.isBiometricLogin },
),
)
}
@ -484,13 +484,6 @@ data class VaultUnlockState(
*/
val showKeyboard: Boolean get() = !showBiometricLogin && !hideInput
/**
* Indicates if the vault is being unlocked as a result of receiving a FIDO 2 request.
*/
val isUnlockingForFido2Request: Boolean
get() = fido2GetCredentialsRequest != null ||
fido2CredentialAssertionRequest != null
/**
* Returns the user ID present in the current FIDO 2 request, or null when no FIDO 2 request is
* present.

View File

@ -767,10 +767,9 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
vaultUnlockType = VaultUnlockType.MASTER_PASSWORD,
)
val viewModel = createViewModel(state = initialState)
val error = Throwable("Fail")
coEvery {
vaultRepository.unlockVaultWithMasterPassword(password)
} returns VaultUnlockResult.AuthenticationError(error = error)
} returns VaultUnlockResult.AuthenticationError(error = Throwable("Fail"))
viewModel.trySendAction(VaultUnlockAction.UnlockClick)
assertEquals(
@ -778,7 +777,6 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
dialog = VaultUnlockState.VaultUnlockDialog.Error(
R.string.an_error_has_occurred.asText(),
R.string.invalid_master_password.asText(),
throwable = error,
),
),
viewModel.stateFlow.value,
@ -937,10 +935,9 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
vaultUnlockType = VaultUnlockType.PIN,
)
val viewModel = createViewModel(state = initialState)
val error = Throwable("Fail")
coEvery {
vaultRepository.unlockVaultWithPin(pin)
} returns VaultUnlockResult.AuthenticationError(error = error)
} returns VaultUnlockResult.AuthenticationError(error = Throwable("Fail"))
viewModel.trySendAction(VaultUnlockAction.UnlockClick)
assertEquals(
@ -948,7 +945,6 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
dialog = VaultUnlockState.VaultUnlockDialog.Error(
title = R.string.an_error_has_occurred.asText(),
message = R.string.invalid_pin.asText(),
throwable = error,
),
),
viewModel.stateFlow.value,