mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
Add sequentialize to prevent parralel loading of cipher keys (#7)
* Add sequentialize to prevent parralel loading of cipher keys Massively improves start up performance of extensions * Add tests for sequentialize * Fix sequentialize as it was caching calls for all instances together * Add sequentialize to the functions that have internal caches * Adding sequentialize to getOrgKeys makes big performance difference * Update cipher.service.ts * Update collection.service.ts * Update folder.service.ts
This commit is contained in:
@@ -2,6 +2,7 @@ import { EncryptionType } from '../../enums/encryptionType';
|
||||
|
||||
import { CryptoService } from '../../abstractions/crypto.service';
|
||||
|
||||
import { sequentialize } from '../../misc/sequentialize';
|
||||
import { Utils } from '../../misc/utils';
|
||||
|
||||
export class CipherString {
|
||||
@@ -89,6 +90,7 @@ export class CipherString {
|
||||
}
|
||||
}
|
||||
|
||||
@sequentialize((args) => args[0])
|
||||
async decrypt(orgId: string): Promise<string> {
|
||||
if (this.decryptedValue) {
|
||||
return Promise.resolve(this.decryptedValue);
|
||||
|
||||
Reference in New Issue
Block a user