mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +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
This commit is contained in:
@@ -272,11 +272,16 @@ export class FolderService implements InternalFolderServiceAbstraction {
|
||||
return [];
|
||||
}
|
||||
|
||||
const decryptFolderPromises = folders.map((f) =>
|
||||
f.decryptWithKey(userKey, this.encryptService),
|
||||
);
|
||||
const decryptedFolders = await Promise.all(decryptFolderPromises);
|
||||
decryptedFolders.sort(Utils.getSortFunction(this.i18nService, "name"));
|
||||
const decryptFolderPromises = folders.map(async (f) => {
|
||||
try {
|
||||
return await f.decryptWithKey(userKey, this.encryptService);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
const decryptedFolders = (await Promise.all(decryptFolderPromises))
|
||||
.filter((p) => p !== null)
|
||||
.sort(Utils.getSortFunction(this.i18nService, "name"));
|
||||
|
||||
const noneFolder = new FolderView();
|
||||
noneFolder.name = this.i18nService.t("noneFolder");
|
||||
|
||||
Reference in New Issue
Block a user