mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Broken commit order in 2.6 #5988
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stof on GitHub (Jun 15, 2018).
Originally assigned to: @Majkl578, @guilhermeblanco on GitHub.
BC Break Report
Summary
Commit order is wrong in some cases, leading to broken inserts (inserting without the id for the foreign key). this is dependant on the order of
persist()calls.Previous behavior
Flushing was working fine
Current behavior
Flush is failing by trying to insert
NULLin a non-nullable foreign key (probably planning to update the field later).How to reproduce
See #7260 which provides some tests reproducing the issue.
@stof commented on GitHub (Jun 15, 2018):
@guilhermeblanco as you rewrote the CommitOrderCalculator in 2.6 (in https://github.com/doctrine/doctrine2/pull/1570), you may want to look at this issue
@pestaa commented on GitHub (Jul 11, 2018):
When both the vertex and the adjacent vertex are in progress, the adjacent vertex might get added to the sorted node list, even though it could have other non-visited dependencies.
It gives correct results if you first sort vertex dependencies by descending weight:
@stof commented on GitHub (Aug 21, 2018):
@guilhermeblanco have you had any chance to take a look at it ?
@stof commented on GitHub (Sep 20, 2018):
@guilhermeblanco I think that when reaching an in-progress node, instead of adding it immediately in the list, we might want to trigger the processing of its own dependencies which are not yet in progress (in case we reached the cycle through the first dependency, and so second dependency was not processed yet). Does it look sensible to you ?
@Majkl578 commented on GitHub (Sep 23, 2018):
Fixed in #7260.