Skip to content

Commit 28346be

Browse files
justindbaurdiffersthecat
authored andcommitted
[PM-21279] Cipher for url speedup (#14684)
* Use `perUserCache$` for `getAllDecryptedForUrl` * Fix loads before first lock * Filter out null ciphers
1 parent 9df8a3c commit 28346be

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

libs/common/src/vault/services/cipher.service.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,15 @@ export class CipherService implements CipherServiceAbstraction {
515515
includeOtherTypes?: CipherType[],
516516
defaultMatch: UriMatchStrategySetting = null,
517517
): Promise<CipherView[]> {
518-
const ciphers = await this.getAllDecrypted(userId);
519-
return await this.filterCiphersForUrl(ciphers, url, includeOtherTypes, defaultMatch);
518+
return await firstValueFrom(
519+
this.cipherViews$(userId).pipe(
520+
filter((c) => c != null),
521+
switchMap(
522+
async (ciphers) =>
523+
await this.filterCiphersForUrl(ciphers, url, includeOtherTypes, defaultMatch),
524+
),
525+
),
526+
);
520527
}
521528

522529
async filterCiphersForUrl(

0 commit comments

Comments
 (0)