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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -313,7 +313,7 @@ export class VaultFilterComponent implements OnInit, OnDestroy {
const data$ = combineLatest([
this.restrictedItemTypesService.restricted$,
this.cipherService.cipherViews$(userId),
this.cipherService.cipherListViews$(userId),
]).pipe(
map(([restrictedTypes, ciphers]) => {
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.
*/
cipherListViews$ = perUserCache$((userId: UserId) => {
let decryptStartTime: number;
return this.configService.getFeatureFlag$(FeatureFlag.PM22134SdkCipherListView).pipe(
switchMap((useSdk) => {
if (!useSdk) {
@ -158,11 +160,23 @@ export class CipherService implements CipherServiceAbstraction {
(cipherData) => new Cipher(cipherData, localData?.[cipherData.id as CipherId]),
),
),
tap(() => {
decryptStartTime = performance.now();
}),
switchMap(async (ciphers) => {
const [decrypted, failures] = await this.decryptCiphersWithSdk(ciphers, userId, false);
await this.setFailedDecryptedCiphers(failures, userId);
return decrypted;
}),
tap((decrypted) => {
this.logService.measure(
decryptStartTime,
"Vault",
"CipherService",
"listView decrypt complete",
[["Items", decrypted.length]],
);
}),
);
}),
);