-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[3.1.1] Set ordinal key values for embedded owned collection entities #19100
Conversation
4e3d09d
to
1eeb280
Compare
Moving the key modification detection logic turned out to require more changes than I initially though, so filed #19135 to consider it later. |
1eeb280
to
0aa874d
Compare
Consistently allow readonly properties to be set the current store values during SaveChanges to allow propagation of the new values. Fixes #18948
0aa874d
to
c2921e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this go in 3.1.1 or 3.1.2? |
@smitpatel If Tactics approves, then it will go in 3.1.2. (3.1.1 is closed down now.) |
Closed 3.1.1 milestone. |
@AndriySvyryd This is approved for 3.1.1 servicing. Please merge ASAP. |
Approved for 3.1.1 |
Fixes #18948
Description
Cosmos provider allows to save collections of owned entities as embedded documents in a JSON array property in the owner document without storing the key values explicitly. They are synthesized from the owner key and the ordinal in the collection. However we didn't synthesize the values when saving the entities, only when querying.
The fix is to synthesize the key values when saving the entities. And also consistently allow readonly properties to be set the current store values during SaveChanges to allow propagation of the new values.
Customer Impact
The bug leads to the newly saved entities having a different identity and causes duplication in the owned collections if queried after saving a new entity using the same context.
How found
Customer-reported
Test coverage
We did not have tests querying back the entities that were just saved using the same context.
Regression?
No
Risk
Low, only affects the Cosmos provider