-
Notifications
You must be signed in to change notification settings - Fork 351
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
Fix delta deleted entry deserialization failure observed when reason appears before id in payload #2787
Fix delta deleted entry deserialization failure observed when reason appears before id in payload #2787
Conversation
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.
// If the current node is the id property - read it. | ||
if (this.JsonReader.NodeType == JsonNodeType.Property && | ||
string.Equals(JsonLightConstants.ODataIdPropertyName, this.JsonReader.GetPropertyName(), StringComparison.Ordinal)) | ||
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.
Typically, for property reading, we are using while () {}
loop.
I am not fans for 'while()' loop. But, If we can keep it consistent, it could be better.
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.
@xuzhg I replaced the do {} while
into a while {}
loop. I figure it especially made sense if the JSON was malformed
I honestly find it funny that we have such a bug. |
…before id in payload
55c8629
to
3466d3d
Compare
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) |
Issues
This pull request fixes #2604.
Description
This pull request fixes deserialization failure observed when
reason
property appears beforeid
property in a delta deleted entry (4.0) payload, e.g.:Fixed by modifying the logic in
ODataJsonLightResourceDeserializer
'sReadDeletedEntry
andReadDeletedEntryAsync
methods to read the properties in whichever order they appear.Checklist (Uncheck if it is not completed)