From 99445e1ca6535d0be29c83965cb8abd12d6e3c92 Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Mon, 23 Feb 2026 09:53:01 -0800 Subject: [PATCH] [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 --- libs/common/src/vault/services/cipher.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/common/src/vault/services/cipher.service.ts b/libs/common/src/vault/services/cipher.service.ts index 70d2458cff2..c87a679dbf4 100644 --- a/libs/common/src/vault/services/cipher.service.ts +++ b/libs/common/src/vault/services/cipher.service.ts @@ -1407,8 +1407,8 @@ export class CipherService implements CipherServiceAbstraction { async deleteWithServer(id: string, userId: UserId, asAdmin = false): Promise { 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 { 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 { 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 { 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 { 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 { 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; }