From fe0d7df538e3b561680db3767fc99b3773f34180 Mon Sep 17 00:00:00 2001 From: Jonathan Prusik Date: Tue, 3 Feb 2026 11:05:02 -0500 Subject: [PATCH] when only password and new password fields have values and do not match any vault ciphers, trigger a new cipher notification (#18729) --- .../background/notification.background.spec.ts | 12 ++++++++++-- .../autofill/background/notification.background.ts | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/browser/src/autofill/background/notification.background.spec.ts b/apps/browser/src/autofill/background/notification.background.spec.ts index 0be6e5c0ac1..7d33d79a697 100644 --- a/apps/browser/src/autofill/background/notification.background.spec.ts +++ b/apps/browser/src/autofill/background/notification.background.spec.ts @@ -1727,7 +1727,7 @@ describe("NotificationBackground", () => { expect(pushAddLoginToQueueSpy).not.toHaveBeenCalled(); }); - it("and no cipher update candidates match `password` or `newPassword`, do not trigger a notification", async () => { + it("and no cipher update candidates match `password` or `newPassword`, trigger a new cipher notification", async () => { const storedCiphersForURL = [ mock({ id: "cipher-id-1", @@ -1745,7 +1745,15 @@ describe("NotificationBackground", () => { await notificationBackground.triggerCipherNotification(formEntryData, tab); expect(pushChangePasswordToQueueSpy).not.toHaveBeenCalled(); - expect(pushAddLoginToQueueSpy).not.toHaveBeenCalled(); + expect(pushAddLoginToQueueSpy).toHaveBeenCalledWith( + mockFormattedURI, + { + password: formEntryData.newPassword, + url: formEntryData.uri, + username: formEntryData.username, + }, + sender.tab, + ); }); }); diff --git a/apps/browser/src/autofill/background/notification.background.ts b/apps/browser/src/autofill/background/notification.background.ts index 33d65391c25..e97672c1f0d 100644 --- a/apps/browser/src/autofill/background/notification.background.ts +++ b/apps/browser/src/autofill/background/notification.background.ts @@ -992,6 +992,7 @@ export default class NotificationBackground { inputScenarios.usernameNewPassword, inputScenarios.usernamePassword, inputScenarios.username, + inputScenarios.passwordNewPassword, ] as InputScenario[] ).includes(inputScenario) && newLoginNotificationIsEnabled