1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-24 16:43:27 +00:00

[PM-31958] BUGFIX: Blank Screen showing after deleting item (#18860)

* Move clearCache calls before SDK calls, to prevent race conditions from firing.

* Swap calls to clearCache and restoreWithServer/restoreManyWithServer to fix race condition
This commit is contained in:
Nik Gilmore
2026-02-23 09:53:01 -08:00
committed by GitHub
parent c5e73b4b8c
commit 99445e1ca6

View File

@@ -1407,8 +1407,8 @@ export class CipherService implements CipherServiceAbstraction {
async deleteWithServer(id: string, userId: UserId, asAdmin = false): Promise<void> {
const useSdk = await firstValueFrom(this.sdkCipherCrudEnabled$);
if (useSdk) {
await this.cipherSdkService.deleteWithServer(id, userId, asAdmin);
await this.clearCache(userId);
await this.cipherSdkService.deleteWithServer(id, userId, asAdmin);
return;
}
@@ -1429,8 +1429,8 @@ export class CipherService implements CipherServiceAbstraction {
): Promise<void> {
const useSdk = await firstValueFrom(this.sdkCipherCrudEnabled$);
if (useSdk) {
await this.cipherSdkService.deleteManyWithServer(ids, userId, asAdmin, orgId);
await this.clearCache(userId);
await this.cipherSdkService.deleteManyWithServer(ids, userId, asAdmin, orgId);
return;
}
@@ -1604,8 +1604,8 @@ export class CipherService implements CipherServiceAbstraction {
async softDeleteWithServer(id: string, userId: UserId, asAdmin = false): Promise<void> {
const useSdk = await firstValueFrom(this.sdkCipherCrudEnabled$);
if (useSdk) {
await this.cipherSdkService.softDeleteWithServer(id, userId, asAdmin);
await this.clearCache(userId);
await this.cipherSdkService.softDeleteWithServer(id, userId, asAdmin);
return;
}
@@ -1626,8 +1626,8 @@ export class CipherService implements CipherServiceAbstraction {
): Promise<void> {
const useSdk = await firstValueFrom(this.sdkCipherCrudEnabled$);
if (useSdk) {
await this.cipherSdkService.softDeleteManyWithServer(ids, userId, asAdmin, orgId);
await this.clearCache(userId);
await this.cipherSdkService.softDeleteManyWithServer(ids, userId, asAdmin, orgId);
return;
}
@@ -1677,8 +1677,8 @@ export class CipherService implements CipherServiceAbstraction {
async restoreWithServer(id: string, userId: UserId, asAdmin = false): Promise<void> {
const useSdk = await firstValueFrom(this.sdkCipherCrudEnabled$);
if (useSdk) {
await this.cipherSdkService.restoreWithServer(id, userId, asAdmin);
await this.clearCache(userId);
await this.cipherSdkService.restoreWithServer(id, userId, asAdmin);
return;
}
@@ -1699,8 +1699,8 @@ export class CipherService implements CipherServiceAbstraction {
async restoreManyWithServer(ids: string[], userId: UserId, orgId?: string): Promise<void> {
const useSdk = await firstValueFrom(this.sdkCipherCrudEnabled$);
if (useSdk) {
await this.cipherSdkService.restoreManyWithServer(ids, userId, orgId);
await this.clearCache(userId);
await this.cipherSdkService.restoreManyWithServer(ids, userId, orgId);
return;
}