1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

Fix SingleUserStateProvider (#7593)

* Fix SingleUserStateProvider

- Fix cache key to be unique per instance per user

* Add Specific State Provider Tests

* Add Missing await
This commit is contained in:
Justin Baur
2024-01-18 13:02:30 -05:00
committed by GitHub
parent 5810b0c7a2
commit 57609737f1
4 changed files with 152 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ export class CryptoService implements CryptoServiceAbstraction {
userId ??= (await firstValueFrom(this.accountService.activeAccount$))?.id;
if (key != null) {
// Key should never be null anyway
this.stateProvider.getUser(userId, USER_EVER_HAD_USER_KEY).update(() => true);
await this.stateProvider.getUser(userId, USER_EVER_HAD_USER_KEY).update(() => true);
}
await this.stateService.setUserKey(key, { userId: userId });
await this.storeAdditionalKeys(key, userId);