Environment
Jmix version: 2.8+
Bug Description
Reproduces only with not saved entities.
When we have association with bidirectional reference it causes recursion to reach the same managed entity again, DataContext#mergeList() re-enters and writes to the same dstList as the outer call, producing duplicate elements in the owner's collection.
For instance:
ProductSet with Product collection
Product with ProductSet link
Steps To Reproduce
- Download demo: datacontext-demo.zip
- Launch the application
- Open "Product sets"
- Create one, do no save
- Create Product 1, Product 2
- Edit Product 1, edit Product 2
Current Behavior
After saving editions in Product 2 there are 4 rows with duplications instead of 2 rows.
Expected Behavior
2 rows with changes we've made in editor.
Environment
Jmix version: 2.8+
Bug Description
Reproduces only with not saved entities.
When we have association with bidirectional reference it causes recursion to reach the same managed entity again,
DataContext#mergeList()re-enters and writes to the samedstListas the outer call, producing duplicate elements in the owner's collection.For instance:
ProductSetwithProductcollectionProductwithProductSetlinkSteps To Reproduce
Current Behavior
After saving editions in Product 2 there are 4 rows with duplications instead of 2 rows.
Expected Behavior
2 rows with changes we've made in editor.