brikteknologier / seraph-model

thin model layer for seraph/neo4j (node.js)
MIT License
111 stars 28 forks source link

Moving composed nodes does not remove redundant relationship #126

Open p-m-p opened 7 years ago

p-m-p commented 7 years ago

We've encountered a situation where we move a node from one relationship to another but the redundant relationship is not removed. As an example with the below compositions LINE_MANAGER is updated and the existing node is then set as a FORMER_LINE_MANAGER. There should only be one line manager but we end up with two as this line https://github.com/brikteknologier/seraph-model/blob/master/lib/write.js#L229 does not check how the target nodes are related in the deletion phase.

Model.compose(Manager, 'lineManager', 'LINE_MANAGER');
Model.compose(Manager, 'formerLineManagers', 'FORMER_LINE_MANAGER', { many: true });

We've coded around the issue but just wanted to make you aware if you are actively maintaining this project.

Thanks!