1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 05:53:42 +00:00

update lastUsedDate in background script

This commit is contained in:
jaasen-livefront
2025-01-28 17:01:18 -08:00
parent cb24266e9d
commit bce53fc540
3 changed files with 12 additions and 1 deletions

View File

@@ -463,8 +463,13 @@ export default class AutofillService implements AutofillServiceInterface {
fillScript.properties.delay_between_operations = 20;
didAutofill = true;
if (!options.skipLastUsed) {
await this.cipherService.updateLastUsedDate(options.cipher.id);
// In order to prevent a UI update send message to background script to update last used date
await chrome.runtime.sendMessage({
command: "updateLastUsedDate",
cipherId: options.cipher.id,
});
}
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.

View File

@@ -1118,6 +1118,7 @@ export default class MainBackground {
this.accountService,
lockService,
this.billingAccountProfileStateService,
this.cipherService,
);
this.nativeMessagingBackground = new NativeMessagingBackground(
this.keyService,

View File

@@ -16,6 +16,7 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag
import { MessageListener, isExternalMessage } from "@bitwarden/common/platform/messaging";
import { devFlagEnabled } from "@bitwarden/common/platform/misc/flags";
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { CipherType } from "@bitwarden/common/vault/enums";
import { BiometricsCommands } from "@bitwarden/key-management";
@@ -53,6 +54,7 @@ export default class RuntimeBackground {
private accountService: AccountService,
private readonly lockService: LockService,
private billingAccountProfileStateService: BillingAccountProfileStateService,
private cipherService: CipherService,
) {
// onInstalled listener must be wired up before anything else, so we do it in the ctor
chrome.runtime.onInstalled.addListener((details: any) => {
@@ -200,6 +202,9 @@ export default class RuntimeBackground {
case BiometricsCommands.GetBiometricsStatusForUser: {
return await this.main.biometricsService.getBiometricsStatusForUser(msg.userId);
}
case "updateLastUsedDate": {
return await this.cipherService.updateLastUsedDate(msg.cipherId);
}
case "getUseTreeWalkerApiForPageDetailsCollectionFeatureFlag": {
return await this.configService.getFeatureFlag(
FeatureFlag.UseTreeWalkerApiForPageDetailsCollection,