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

Generate temp values for key properties contained in optional FKs #27579

Merged
merged 1 commit into from
Mar 8, 2022

Conversation

AndriySvyryd
Copy link
Member

Fixes #27455

Description

We stopped marking properties as store-generated when they are contained in an FK cycle to avoid stack overflows. However, this also affected cycles that contain an optional composite FK that can be used to break the cycle.

Customer impact

For models that contain an FK cycle with an optional composite FK SaveChanges will throw an exception when propagating the store-generated value.

How found

Reported by a customer.

Regression

Yes, in 6.0.0

Testing

Added a test for the given scenario.

Risk

Low, also added a quirk mode.

Don't throw for unknown values that won't be sent to the database

Fixes #27455
@leecow leecow modified the milestones: 6.0.x, 6.0.4 Mar 8, 2022
@AndriySvyryd AndriySvyryd changed the title [release/6.0] Generate temp values for key properties contained in optional FKs Generate temp values for key properties contained in optional FKs Mar 8, 2022
@AndriySvyryd AndriySvyryd merged commit 7e4b771 into release/6.0 Mar 8, 2022
@AndriySvyryd AndriySvyryd deleted the Issue27455 branch March 8, 2022 18:29
@AndriySvyryd AndriySvyryd removed this from the 6.0.4 milestone Mar 8, 2022
@dougbu dougbu added this to the 6.0.4 milestone Apr 5, 2022
@ajcvickers ajcvickers removed this from the 6.0.4 milestone Apr 18, 2022
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.

4 participants