mirror of
https://github.com/bitwarden/clients.git
synced 2025-12-10 21:05:10 -06:00
Switched to used cipher list view for vault filters, and added perfomance logs for cipher list views (#17688)
This commit is contained in:
parent
598bb0b0d7
commit
8522b6b87a
@ -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
|
||||
|
||||
@ -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]],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user