1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 17:53:39 +00:00

Changed logic to validate if cipher has a collection on targetSelector method (#8422)

Added tests to import.service.spec.ts that test if the collectionRelationship and folderRelationship properly adapts
This commit is contained in:
aj-rosado
2024-03-25 18:10:40 +00:00
committed by GitHub
parent 2ae6fbe275
commit b180463cc0
3 changed files with 97 additions and 2 deletions

View File

@@ -437,8 +437,10 @@ export class ImportService implements ImportServiceAbstraction {
const noCollectionRelationShips: [number, number][] = [];
importResult.ciphers.forEach((c, index) => {
if (!Array.isArray(c.collectionIds) || c.collectionIds.length == 0) {
c.collectionIds = [importTarget.id];
if (
!Array.isArray(importResult.collectionRelationships) ||
!importResult.collectionRelationships.some(([cipherPos]) => cipherPos === index)
) {
noCollectionRelationShips.push([index, 0]);
}
});