TryGetPropertyValue on a nested ComplexType returns T, should be Delta<T>#2570
Conversation
038af95 to
fac88db
Compare
Sreejithpin
left a comment
There was a problem hiding this comment.
Couple of things
- This is done for TryGetPropertyValue and not TrySetPropertyvalue (as mentioned in PR)
- This used to get value, and probably the purpose is same , IF we change it it would be a breaking change as well, right?
@mikepizzo Please see
|
For 1) You are correct. Existing behavior is that the caller can "set" a nested property as a value T or as a For 2) it is a change in behavior. From my limited investigation existing use in the OData repos, there are no caller to As I said in the related issue, a root cause of the problem is that the documentation incorrectly states that the
Likewise in the
In reply to: 926826747 |
c8032dd to
61c05dc
Compare
2f8a0ec to
026e58a
Compare
|
Yes, this is broken, and I want to take the fix, but we can't risk breaking existing applications. We should definitely fix this in 8.x. For 7.x, can we do something like add a TryGetPropertyValue2 that does the right thing (and then use that in our serialization)? In reply to: 926826747 |
|
@mikepizzo Proposed backwards compatible fix:
Rationale: The existing API is only broken in one specific narrow scenario that is not likely used very often. If we create a new API that supports the full existing semantics plus the fix, developers may switch to the new API for all scenarios thinking that it is the expected future direction, even if they are not using it for nested properties. This could result in code unnecessarily migrating to the new API then having to migrate back in the next major version, this is inertia to keep the two APIs for longer than desired. By creating a limited API, only developers who need the fixed semantic will opt-in and the Obsolete attribute will indicate that this is just a temporary fix and only these calls need to be updated in the future. We also have to port this to AspNetCoreOData. In the 8.x timeframe the Delta code needs to be refactored to remove duplication. In my branches I have greatly minimized the differences in DeltaOfT and DeltaTests, but they will get out of sync quickly. Edit: Do not mark as obsolete |
I think it would be ok to let this method continue to exist, but be a passthrough implementation in the next major version, reducing the friction for clients who need these changes now. |
Did not add ObsoleteAttribute. |
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
@mikepizzo Please review In reply to: 974882988 |
mikepizzo
left a comment
There was a problem hiding this comment.
Changes look good -- thanks @dxrdxr!
@xuzhg -- Since 8.x is still fairly new, I'm okay fixing TryGetPropertyValue in 8.x without adding the new TryGetNestedPropertyValue. What do you think? If we were really worried about breaking backward compat we could add a flag (off by default) in 8.x to retain the old behavior.
Issues
This pull request fixes #2500.
Description
As discussed in the issue, fix
TrySetPropertyValueto returnDelta<T>when a nested complex property.Checklist (Uncheck if it is not completed)
Additional work necessary
Docs Needed
In addition to the functionality changes the following was also done: