1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 20:50: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 Robyn MacCallum
parent 9df8a3cc50
commit 28346be0df

View File

@@ -515,8 +515,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(