Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0.2] Detach join entity when removing added relationship #26892

Merged
merged 1 commit into from
Dec 15, 2021

Commits on Dec 3, 2021

  1. [6.0.2] Detach join entity when removing added relationship

    Fixes #26779
    
    **Description**
    
    When a many-to-many relationship is created and then removed, the state of the join entity that represents this relationship is incorrectly changed to `Deleted`. This results in an attempt to delete a row in the database that does not exist.
    
    **Customer impact**
    
    Exception thrown when calling SaveChanges after adding and then removing a new many-to-many relationships.
    
    This is a fairly fundamental error. What is not clear is why this was not reported before now, since the behavior existed in 5.0. It's possible people didn't realize it was a bug and having been manually detaching the join entity to make this scenario work.
    
    **How found**
    
    Customer reported on 6.0.
    
    **Regression**
    
    This is not a regression; the same behavior existing in 5.0. However, we believe that it is a fundamental behavior that should work, hence we believe we should patch in 6.0.
    
    **Testing**
    
    Added a range of new tests for this and related scenarios with different types of many-to-many relationships.
    
    **Risk**
    
    Low; the change is very simple, and is also quirked.
    ajcvickers committed Dec 3, 2021
    Configuration menu
    Copy the full SHA
    46a4eda View commit details
    Browse the repository at this point in the history