1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 18:23:31 +00:00

[PM-26096] Bugfix: Decryption errors for folders prevent vault access (#16796)

* Handle scenario where folders fail to decrypt

* Add comment explaining the folderViews$ filter check

(cherry picked from commit 4d2106a7c0)
This commit is contained in:
Nik Gilmore
2025-10-09 10:46:20 -07:00
parent cd6fce0ec0
commit f3af6a813a
2 changed files with 16 additions and 8 deletions

View File

@@ -59,9 +59,12 @@ export class DefaultCipherFormConfigService implements CipherFormConfigService {
this.organizationDataOwnershipDisabled$,
this.folderService.folders$(activeUserId).pipe(
switchMap((f) =>
this.folderService.folderViews$(activeUserId).pipe(
filter((d) => d.length - 1 === f.length), // -1 for "No Folder" in folderViews$
),
this.folderService
.folderViews$(activeUserId)
// Ensure the folders have decrypted. f.length === 0 indicates we don't have any
// folders to wait for, and d.length > 0 indicates that `folderViews` has emitted the
// array, which includes the "No Folder" default folder.
.pipe(filter((d) => d.length > 0 || f.length === 0)),
),
),
this.getCipher(activeUserId, cipherId),