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, "generateFillScript");
|
||||||
jest.spyOn(autofillService as any, "generateLoginFillScript");
|
jest.spyOn(autofillService as any, "generateLoginFillScript");
|
||||||
jest.spyOn(logService, "info");
|
jest.spyOn(logService, "info");
|
||||||
jest.spyOn(chrome.runtime, "sendMessage");
|
jest.spyOn(cipherService, "updateLastUsedDate");
|
||||||
jest.spyOn(eventCollectionService, "collect");
|
jest.spyOn(eventCollectionService, "collect");
|
||||||
|
|
||||||
const autofillResult = await autofillService.doAutoFill(autofillOptions);
|
const autofillResult = await autofillService.doAutoFill(autofillOptions);
|
||||||
@@ -769,10 +769,7 @@ describe("AutofillService", () => {
|
|||||||
);
|
);
|
||||||
expect(autofillService["generateLoginFillScript"]).toHaveBeenCalled();
|
expect(autofillService["generateLoginFillScript"]).toHaveBeenCalled();
|
||||||
expect(logService.info).not.toHaveBeenCalled();
|
expect(logService.info).not.toHaveBeenCalled();
|
||||||
expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({
|
expect(cipherService.updateLastUsedDate).toHaveBeenCalledWith(autofillOptions.cipher.id);
|
||||||
cipherId: autofillOptions.cipher.id,
|
|
||||||
command: "updateLastUsedDate",
|
|
||||||
});
|
|
||||||
expect(chrome.tabs.sendMessage).toHaveBeenCalledWith(
|
expect(chrome.tabs.sendMessage).toHaveBeenCalledWith(
|
||||||
autofillOptions.pageDetails[0].tab.id,
|
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 () => {
|
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;
|
autofillOptions.skipLastUsed = true;
|
||||||
jest.spyOn(chrome.runtime, "sendMessage");
|
jest.spyOn(cipherService, "updateLastUsedDate");
|
||||||
|
|
||||||
await autofillService.doAutoFill(autofillOptions);
|
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 () => {
|
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;
|
fillScript.properties.delay_between_operations = 20;
|
||||||
|
|
||||||
didAutofill = true;
|
didAutofill = true;
|
||||||
|
|
||||||
if (!options.skipLastUsed) {
|
if (!options.skipLastUsed) {
|
||||||
// In order to prevent a UI update send message to background script to update last used date
|
await this.cipherService.updateLastUsedDate(options.cipher.id);
|
||||||
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.
|
// 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,
|
this.accountService,
|
||||||
lockService,
|
lockService,
|
||||||
this.billingAccountProfileStateService,
|
this.billingAccountProfileStateService,
|
||||||
this.cipherService,
|
|
||||||
);
|
);
|
||||||
this.nativeMessagingBackground = new NativeMessagingBackground(
|
this.nativeMessagingBackground = new NativeMessagingBackground(
|
||||||
this.keyService,
|
this.keyService,
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import { MessageListener, isExternalMessage } from "@bitwarden/common/platform/m
|
|||||||
import { devFlagEnabled } from "@bitwarden/common/platform/misc/flags";
|
import { devFlagEnabled } from "@bitwarden/common/platform/misc/flags";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { NotificationsService } from "@bitwarden/common/platform/notifications";
|
import { NotificationsService } from "@bitwarden/common/platform/notifications";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
|
||||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||||
import { BiometricsCommands } from "@bitwarden/key-management";
|
import { BiometricsCommands } from "@bitwarden/key-management";
|
||||||
|
|
||||||
@@ -54,7 +53,6 @@ export default class RuntimeBackground {
|
|||||||
private accountService: AccountService,
|
private accountService: AccountService,
|
||||||
private readonly lockService: LockService,
|
private readonly lockService: LockService,
|
||||||
private billingAccountProfileStateService: BillingAccountProfileStateService,
|
private billingAccountProfileStateService: BillingAccountProfileStateService,
|
||||||
private cipherService: CipherService,
|
|
||||||
) {
|
) {
|
||||||
// onInstalled listener must be wired up before anything else, so we do it in the ctor
|
// onInstalled listener must be wired up before anything else, so we do it in the ctor
|
||||||
chrome.runtime.onInstalled.addListener((details: any) => {
|
chrome.runtime.onInstalled.addListener((details: any) => {
|
||||||
@@ -202,9 +200,6 @@ export default class RuntimeBackground {
|
|||||||
case BiometricsCommands.GetBiometricsStatusForUser: {
|
case BiometricsCommands.GetBiometricsStatusForUser: {
|
||||||
return await this.main.biometricsService.getBiometricsStatusForUser(msg.userId);
|
return await this.main.biometricsService.getBiometricsStatusForUser(msg.userId);
|
||||||
}
|
}
|
||||||
case "updateLastUsedDate": {
|
|
||||||
return await this.cipherService.updateLastUsedDate(msg.cipherId);
|
|
||||||
}
|
|
||||||
case "getUseTreeWalkerApiForPageDetailsCollectionFeatureFlag": {
|
case "getUseTreeWalkerApiForPageDetailsCollectionFeatureFlag": {
|
||||||
return await this.configService.getFeatureFlag(
|
return await this.configService.getFeatureFlag(
|
||||||
FeatureFlag.UseTreeWalkerApiForPageDetailsCollection,
|
FeatureFlag.UseTreeWalkerApiForPageDetailsCollection,
|
||||||
|
|||||||
Reference in New Issue
Block a user