mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
This reverts commit 1b3bc71e50.
This commit is contained in:
@@ -747,7 +747,7 @@ describe("AutofillService", () => {
|
||||
jest.spyOn(autofillService as any, "generateFillScript");
|
||||
jest.spyOn(autofillService as any, "generateLoginFillScript");
|
||||
jest.spyOn(logService, "info");
|
||||
jest.spyOn(chrome.runtime, "sendMessage");
|
||||
jest.spyOn(cipherService, "updateLastUsedDate");
|
||||
jest.spyOn(eventCollectionService, "collect");
|
||||
|
||||
const autofillResult = await autofillService.doAutoFill(autofillOptions);
|
||||
@@ -769,10 +769,7 @@ describe("AutofillService", () => {
|
||||
);
|
||||
expect(autofillService["generateLoginFillScript"]).toHaveBeenCalled();
|
||||
expect(logService.info).not.toHaveBeenCalled();
|
||||
expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({
|
||||
cipherId: autofillOptions.cipher.id,
|
||||
command: "updateLastUsedDate",
|
||||
});
|
||||
expect(cipherService.updateLastUsedDate).toHaveBeenCalledWith(autofillOptions.cipher.id);
|
||||
expect(chrome.tabs.sendMessage).toHaveBeenCalledWith(
|
||||
autofillOptions.pageDetails[0].tab.id,
|
||||
{
|
||||
@@ -893,11 +890,11 @@ describe("AutofillService", () => {
|
||||
|
||||
it("skips updating the cipher's last used date if the passed options indicate that we should skip the last used cipher", async () => {
|
||||
autofillOptions.skipLastUsed = true;
|
||||
jest.spyOn(chrome.runtime, "sendMessage");
|
||||
jest.spyOn(cipherService, "updateLastUsedDate");
|
||||
|
||||
await autofillService.doAutoFill(autofillOptions);
|
||||
|
||||
expect(chrome.runtime.sendMessage).not.toHaveBeenCalled();
|
||||
expect(cipherService.updateLastUsedDate).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("returns early if the fillScript cannot be generated", async () => {
|
||||
|
||||
@@ -463,13 +463,8 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||
fillScript.properties.delay_between_operations = 20;
|
||||
|
||||
didAutofill = true;
|
||||
|
||||
if (!options.skipLastUsed) {
|
||||
// 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,
|
||||
});
|
||||
await this.cipherService.updateLastUsedDate(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.
|
||||
|
||||
@@ -1142,7 +1142,6 @@ export default class MainBackground {
|
||||
this.accountService,
|
||||
lockService,
|
||||
this.billingAccountProfileStateService,
|
||||
this.cipherService,
|
||||
);
|
||||
this.nativeMessagingBackground = new NativeMessagingBackground(
|
||||
this.keyService,
|
||||
|
||||
@@ -16,7 +16,6 @@ import { MessageListener, isExternalMessage } from "@bitwarden/common/platform/m
|
||||
import { devFlagEnabled } from "@bitwarden/common/platform/misc/flags";
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { NotificationsService } from "@bitwarden/common/platform/notifications";
|
||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||
import { BiometricsCommands } from "@bitwarden/key-management";
|
||||
|
||||
@@ -54,7 +53,6 @@ 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) => {
|
||||
@@ -202,9 +200,6 @@ 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,
|
||||
|
||||
Reference in New Issue
Block a user