LionWeb-io / lionweb-repository

Reference implementation of LionWeb repository
Apache License 2.0
2 stars 1 forks source link

Unclear error message (ChildMissingInParent) #24

Closed ftomassetti closed 5 months ago

ftomassetti commented 5 months ago

When sending a partition to the repository I got a list of validation errors, the first being:

"ChildMissingInParent: Node with id \"Users_ftomassetti_repos_kolasu-java-langmodule_build_downloaded-examples_arthas_core_src_main_java_com_taobao_arthas_core_Arthas_java__root_declarations_0_members_0_exceptions_0\" has parent with id \"Users_ftomassetti_repos_kolasu-java-langmodule_build_downloaded-examples_arthas_core_src_main_java_com_taobao_arthas_core_Arthas_java__root_declarations_0_members_0\" but parent does not contains it as a child. at $.node[2] "

Followed by other similar errors.

This message confused me because actually the parent list the children correctly. The problem seems to be another: there are two parents containing the same child, for same reason. So probably this confuses the validation process and cause it produce this error message.

ftomassetti commented 5 months ago

I am opening the issue here, because I have noticed it in the lionweb repository, but this is probably something relevant for the validation package in https://github.com/lIonWeb-io/lionweb-typescript, so I am tagging @dslmeinte for an opinion. Should I report the issue on lionweb-typescript instead?

dslmeinte commented 5 months ago

Yeah, I think this should really be fixed in the @lionweb/validation package, so an issue on the TS is appropriate. Could you reduce the JSON you reference here to something much smaller? That JSON could then be added to the integration/validation tests.

joswarmer commented 5 months ago

I found the error. The validator finds an error but reports it as a ChildMissingInParent error, but it should report it as a Parent Incorrect In Child error. Fixed in branch fix/incorrect-parent-child-error.

ftomassetti commented 5 months ago

Thank you @joswarmer and @dslmeinte , I opened the issue in the lionweb-typescript and I am closing it here