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

Fixup deleted join entities #26036

Merged
merged 2 commits into from
Sep 17, 2021
Merged

Fixup deleted join entities #26036

merged 2 commits into from
Sep 17, 2021

Conversation

AndriySvyryd
Copy link
Member

@AndriySvyryd AndriySvyryd commented Sep 15, 2021

Fixes #24123

Description

  • Navigation fixup is erroneously performed using a deleted entity when there is also an added entity with the same key value.
  • Navigation fixup is not performed on many-to-many skip navigations when just the join entity is removed

Customer Impact

  • The first issue causes data corruption that can go undetected as expected changes are not persisted to the database.
  • The second issue is less severe and just causes the client state to go out-of sync with the database after SaveChanges

How found

  • Customer

Test coverage

  • Added regression tests for the scenario.

Regression?

  • No

Risk

  • Medium. This potentially affects many shared-identity and many-to-many scenarios

… instance

Update snapshots on the new entry

Fixes #24123
@AndriySvyryd AndriySvyryd changed the base branch from release/6.0 to release/6.0-rc2 September 16, 2021 19:20
@AndriySvyryd AndriySvyryd changed the title Detect relationship changes when replacing an entity with a different instance [6.0-rc2] Fixup deleted join entities Sep 16, 2021
@AndriySvyryd AndriySvyryd marked this pull request as ready for review September 16, 2021 19:41
@AndriySvyryd
Copy link
Member Author

@ajcvickers This is now ready for review. The previous fix I tried was incorrect. The main two issues were the fix up on ambiguous entries as described above and that we didn't fixup skip navs when the join entity was removed.

@ajcvickers
Copy link
Member

@AndriySvyryd Does this need to go into 6.0?

@AndriySvyryd
Copy link
Member Author

@ajcvickers Yes. Data corruption!

@ajcvickers ajcvickers added this to the 6.0.0-rc2 milestone Sep 17, 2021
@AndriySvyryd AndriySvyryd changed the title [6.0-rc2] Fixup deleted join entities Fixup deleted join entities Sep 17, 2021
@AndriySvyryd AndriySvyryd merged commit 76a18e5 into release/6.0-rc2 Sep 17, 2021
@AndriySvyryd AndriySvyryd deleted the Issue24123 branch September 17, 2021 17:39
@ajcvickers ajcvickers removed this from the 6.0.0-rc2 milestone Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Many-to-Many does not get updated for replaced entity with shared primary key
2 participants