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:
@@ -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
|
||||||
|
|||||||
@@ -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]],
|
||||||
|
);
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user