-
Notifications
You must be signed in to change notification settings - Fork 160
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
Fixes #1332: Deep Comparison for Array-based Concurrency tokens. #1334
base: release-8.x
Are you sure you want to change the base?
Conversation
@WanjohiSammy , may I interest you in this? |
@xuzhg, it's been a little quiet here. Maybe I can help with something? |
@xuzhg , @WanjohiSammy, I see you guys were busy with the |
@WanjohiSammy, bumping this up just in case. |
@@ -60,6 +61,8 @@ private static IEdmModel GetDerivedEdmModel() | |||
EntitySetConfiguration<ETagsDerivedCustomer> eTagsDerivedCustomersSet = builder.EntitySet<ETagsDerivedCustomer>("ETagsDerivedCustomers"); | |||
eTagsDerivedCustomersSet.HasRequiredBinding(c => c.RelatedCustomer, eTagsCustomersSet); | |||
eTagsDerivedCustomersSet.HasRequiredBinding(c => c.ContainedCustomer, eTagsCustomersSet); | |||
eTagsDerivedCustomersSet.EntityType.Ignore(d=>d.RowVersion); |
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.
What's the purpose of excluding this property from EdmModel
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.
@WanjohiSammy I added a new field. Most of these tests were written with the assumption that this field does not exist and therefore do not take its existence into account.
Me ignoring this field from these tests basically ensures that they continue to pass as they did previously since their test cases have nothing to do with the new field I created or the problem at hand.
I'm not overly fond of purposefully ignoring new code that breaks an existing test. Especially considering that the rest of the PR literally revolves around re-passing another existing test.
However, I only resolved to do this after I noticed that other test bases were ignoring one of the fields too for a similar reason. If you go to ETagsOtherTypesTest
, you'd see that both the EDM Models there are ignoring the StringWithConcurrencyCheckAttributeProperty
field.
@anasik tests are missing. Can you add several tests for this Deep Comparison feature |
@WanjohiSammy, If there's something specific you're looking for in terms of tests, please let me know and I'll see what I can do? |
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.
I want to test and make sure that this is not a breaking change
@WanjohiSammy, makes perfect sense. Let me know if any tests are failing and I'll take a look. |
Fixes #1332
A popular convention today for concurrency check fields is to use a
byte[]
field calledRowVersion
with aTimestamp
orConcurrencyCheck
attribute.However, when using such a field, the
queryOptions.ifNoneMatch.ApplyTo
call was having absolutely no effect. That's becauseApplyTo
was internally usingExpression.Equal
which is perfect for value types but doesn't fare very well against reference types or particularly Arrays.I fixed this by adding a case for arrays that, through a helper method, generates an expression that performs a deep comparison.