Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI-7417 - Handle nodes with missing content #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/migrateUIFolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const accumulateStructure = ({
},
},
};
} else {
} else if (folders[id] !== undefined) {
accumulateStructure({
legacyUIFolder,
migratedUIFolder,
Expand All @@ -180,6 +180,10 @@ const accumulateStructure = ({
folders,
path: [...path, id],
});
} else {
console.error(
`The 'structure' folder contains an object of id '${id}' that could not be identified (missing or corrupted entry in 'content'). Children of that object will be ignored.`
Copy link
Collaborator

@antoinetissier antoinetissier Jun 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get that we can warn about the missing entry in content here.
But if the entry is here, and just has a missing content, this is handled outside, isn't it ?
If so, I would remove the part about the corrupt content here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I observed was that you would still attempt to resolve the structure of children of a corrupt node. Then, when trying to create the parent of that child in the new structure, you are not able to find the information about the parent in the legacy structure.

So you need this.

);
}
}
}
Expand Down Expand Up @@ -291,6 +295,10 @@ export function migrateUIFolder(
);
}
}
} else {
console.error(
`The 'content' folder contains a corrupted object of id '${id}' (no content found).`
rgosse marked this conversation as resolved.
Show resolved Hide resolved
);
}
}

Expand Down