1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-21279] Cipher for url speedup (#14684)

* Use `perUserCache$` for `getAllDecryptedForUrl`

* Fix loads before first lock

* Filter out null ciphers
This commit is contained in:
Justin Baur
2025-05-09 16:21:47 -04:00
committed by GitHub
parent 51e327e20b
commit 83dc4706f3

View File

@@ -519,8 +519,15 @@ export class CipherService implements CipherServiceAbstraction {
includeOtherTypes?: CipherType[],
defaultMatch: UriMatchStrategySetting = null,
): Promise<CipherView[]> {
const ciphers = await this.getAllDecrypted(userId);
return await this.filterCiphersForUrl(ciphers, url, includeOtherTypes, defaultMatch);
return await firstValueFrom(
this.cipherViews$(userId).pipe(
filter((c) => c != null),
switchMap(
async (ciphers) =>
await this.filterCiphersForUrl(ciphers, url, includeOtherTypes, defaultMatch),
),
),
);
}
async filterCiphersForUrl(