1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

Switched to used cipher list view for vault filters, and added perfomance logs for cipher list views (#17688)

This commit is contained in:
SmithThe4th
2025-11-26 16:27:48 -05:00
committed by GitHub
parent 598bb0b0d7
commit 8522b6b87a
2 changed files with 15 additions and 1 deletions

View File

@@ -313,7 +313,7 @@ export class VaultFilterComponent implements OnInit, OnDestroy {
const data$ = combineLatest([ const data$ = combineLatest([
this.restrictedItemTypesService.restricted$, this.restrictedItemTypesService.restricted$,
this.cipherService.cipherViews$(userId), this.cipherService.cipherListViews$(userId),
]).pipe( ]).pipe(
map(([restrictedTypes, ciphers]) => { map(([restrictedTypes, ciphers]) => {
const restrictedForUser = restrictedTypes const restrictedForUser = restrictedTypes

View File

@@ -141,6 +141,8 @@ export class CipherService implements CipherServiceAbstraction {
* Usage of the {@link CipherViewLike} type is recommended to ensure both `CipherView` and `CipherListView` are supported. * Usage of the {@link CipherViewLike} type is recommended to ensure both `CipherView` and `CipherListView` are supported.
*/ */
cipherListViews$ = perUserCache$((userId: UserId) => { cipherListViews$ = perUserCache$((userId: UserId) => {
let decryptStartTime: number;
return this.configService.getFeatureFlag$(FeatureFlag.PM22134SdkCipherListView).pipe( return this.configService.getFeatureFlag$(FeatureFlag.PM22134SdkCipherListView).pipe(
switchMap((useSdk) => { switchMap((useSdk) => {
if (!useSdk) { if (!useSdk) {
@@ -158,11 +160,23 @@ export class CipherService implements CipherServiceAbstraction {
(cipherData) => new Cipher(cipherData, localData?.[cipherData.id as CipherId]), (cipherData) => new Cipher(cipherData, localData?.[cipherData.id as CipherId]),
), ),
), ),
tap(() => {
decryptStartTime = performance.now();
}),
switchMap(async (ciphers) => { switchMap(async (ciphers) => {
const [decrypted, failures] = await this.decryptCiphersWithSdk(ciphers, userId, false); const [decrypted, failures] = await this.decryptCiphersWithSdk(ciphers, userId, false);
await this.setFailedDecryptedCiphers(failures, userId); await this.setFailedDecryptedCiphers(failures, userId);
return decrypted; return decrypted;
}), }),
tap((decrypted) => {
this.logService.measure(
decryptStartTime,
"Vault",
"CipherService",
"listView decrypt complete",
[["Items", decrypted.length]],
);
}),
); );
}), }),
); );