1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-06 23:51:28 +01:00

[PM-16932] Fix timeout when desktop app is not started (#12799)

* Fix biometrics button showing up when biometrics is not enabled

* Fix tests

* Fix timeout when desktop app is not started

* Update comments for legacy biometrics removal
This commit is contained in:
Bernd Schoolmann 2025-01-13 19:59:59 +01:00 committed by GitHub
parent ffe05f27c4
commit a54508a0e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 4 deletions

View File

@ -257,7 +257,7 @@ export class NativeMessagingBackground {
message.command == BiometricsCommands.Unlock ||
message.command == BiometricsCommands.IsAvailable
) {
// TODO remove after 2025.01
// TODO remove after 2025.3
// wait until there is no other callbacks, or timeout
const call = await firstValueFrom(
race(

View File

@ -54,7 +54,15 @@ export class ExtensionLockComponentService implements LockComponentService {
if (!(await firstValueFrom(this.biometricStateService.biometricUnlockEnabled$))) {
return BiometricsStatus.NotEnabledLocally;
} else {
return await this.biometricsService.getBiometricsStatusForUser(userId);
// TODO remove after 2025.3
// remove after backward compatibility code for old biometrics ipc protocol is removed
const result: BiometricsStatus = (await Promise.race([
this.biometricsService.getBiometricsStatusForUser(userId),
new Promise((resolve) =>
setTimeout(() => resolve(BiometricsStatus.DesktopDisconnected), 1000),
),
])) as BiometricsStatus;
return result;
}
}),
this.userDecryptionOptionsService.userDecryptionOptionsById$(userId),

View File

@ -188,7 +188,7 @@ export class BiometricMessageHandlerService {
appId,
);
}
// TODO: legacy, remove after 2025.01
// TODO: legacy, remove after 2025.3
case BiometricsCommands.IsAvailable: {
const available =
(await this.biometricsService.getBiometricsStatus()) == BiometricsStatus.Available;
@ -200,7 +200,7 @@ export class BiometricMessageHandlerService {
appId,
);
}
// TODO: legacy, remove after 2025.01
// TODO: legacy, remove after 2025.3
case BiometricsCommands.Unlock: {
const isTemporarilyDisabled =
(await this.biometricStateService.getBiometricUnlockEnabled(message.userId as UserId)) &&