Skip to content

Commit

Permalink
[PM-16932] Fix timeout when desktop app is not started (#12799)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
quexten authored Jan 13, 2025
1 parent ffe05f2 commit a54508a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/browser/src/background/nativeMessaging.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)) &&
Expand Down

0 comments on commit a54508a

Please sign in to comment.