1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Specify Organization indexed on search service (#356)

* Specify Organization indexed on search service

a null indexedEntityId specifies it is the users entire vault.
otherwise, organizations specify their id to signify the index is a subset.

user's vault will re-index if the indexed entity does not match the
users id or null. at the moment, user's vault does not set userId
because indexing occurs in the setter for decryptedCipherCache,
which cannot be asynchronous

* Linter fix
This commit is contained in:
Matt Gibson
2021-04-22 14:53:45 -05:00
committed by GitHub
parent aca098645a
commit 090ad790f5
3 changed files with 10 additions and 2 deletions

View File

@@ -294,6 +294,11 @@ export class CipherService implements CipherServiceAbstraction {
@sequentialize(() => 'getAllDecrypted')
async getAllDecrypted(): Promise<CipherView[]> {
if (this.decryptedCipherCache != null) {
const userId = await this.userService.getUserId();
if ((this.searchService().indexedEntityId ?? userId) !== userId)
{
await this.searchService().indexCiphers();
}
return this.decryptedCipherCache;
}