1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

PM-23890 Update overlays when a cipher is deleted (#15800)

* PM-23890 WIP

* add messaging service references

* Revert "PM-19574 Browser Autofill overlay displays outdated data (#15624)"

This reverts commit 9eceaa3d4c.

* add test

* fix merge spacing

* Revert "Revert "PM-19574 Browser Autofill overlay displays outdated data (#15624)""

This reverts commit 0fc6ec4d0b.
This commit is contained in:
Daniel Riera
2025-08-05 12:17:38 -04:00
committed by GitHub
parent 5f5f771adb
commit 2549afc45d
7 changed files with 44 additions and 2 deletions

View File

@@ -1,9 +1,19 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { combineLatest, filter, firstValueFrom, map, Observable, Subject, switchMap } from "rxjs";
import {
combineLatest,
filter,
firstValueFrom,
map,
Observable,
Subject,
switchMap,
tap,
} from "rxjs";
import { SemVer } from "semver";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessageSender } from "@bitwarden/common/platform/messaging";
// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop.
// eslint-disable-next-line no-restricted-imports
import { KeyService } from "@bitwarden/key-management";
@@ -109,6 +119,7 @@ export class CipherService implements CipherServiceAbstraction {
private accountService: AccountService,
private logService: LogService,
private cipherEncryptionService: CipherEncryptionService,
private messageSender: MessageSender,
) {}
localData$(userId: UserId): Observable<Record<CipherId, LocalData>> {
@@ -174,6 +185,10 @@ export class CipherService implements CipherServiceAbstraction {
]).pipe(
filter(([ciphers, _, keys]) => ciphers != null && keys != null), // Skip if ciphers haven't been loaded yor synced yet
switchMap(() => this.getAllDecrypted(userId)),
tap(async (decrypted) => {
await this.searchService.indexCiphers(userId, decrypted);
this.messageSender.send("updateOverlayCiphers");
}),
);
}, this.clearCipherViewsForUser$);