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

Delay synthesis of join entities until entire graph is attached #24572

Merged
merged 3 commits into from
Apr 3, 2021

Conversation

ajcvickers
Copy link
Member

Fixes #23339

This stops the change tracker creating a join entity instance for the same join entity that is later discovered in the graph.

@ajcvickers ajcvickers requested a review from a team April 2, 2021 20:40
@@ -47,27 +47,36 @@ public class EntityGraphAttacher : IEntityGraphAttacher
EntityState targetState,
EntityState storeGeneratedWithKeySetTargetState,
bool forceStateWhenUnknownKey)
=> _graphIterator.TraverseGraph(
{
rootEntry.StateManager.ResetAttachGraph();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are any danglers at this point why would we discard them?

Also shouldn't we also call CompleteAttachGraph on DetectChanges?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndriySvyryd I thought some more about where danglers can come from and added additional test cases. This lead to a change where I made it more explicit that this is a Begin/End behavior.

Fixes #23339

This stops the change tracker creating a join entity instance for the same join entity that is later discovered in the graph.
@ajcvickers ajcvickers merged commit 72c2ac1 into main Apr 3, 2021
@ajcvickers ajcvickers deleted the TomsDiner0401 branch April 3, 2021 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot save changes because same join entity seems to be added multiple times
2 participants