webgme / webgme-engine

WebGME server and Client API without a GUI
MIT License
11 stars 7 forks source link

Different values returned using getPointerPath vs getBase #211

Open brollb opened 4 years ago

brollb commented 4 years ago

When getting the base of a node implicitly created (structural inheritance), getPointerPath gets the original meta type (not the path of the corresponding node contained in the parent's base) whereas core.getPath(core.getBase(node)) returns the expected path.

kecso commented 3 years ago

I know that it sounds odd, but that is how these functions are expected to work. When figuring out inheritance, you should not use getPointerPath (and in general do not use it with 'base' even though it is technically a pointer...). What happens in the first case is that the pointer itself is inherited and therefore the target of the pointer is the original meta type. The second scenario is what you would expect as it takes implicit inheritance relationships into account.

I will not close the issue (just put it in the enhancement bucket) as it would probably worth to revisit getPointerPath + 'base' scenarios and either throwing exception or enhancing its behavior...