-
Notifications
You must be signed in to change notification settings - Fork 352
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
Commit Utf8JsonWriter contents to buffer before writing directly to b… #2985
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ElizabethOkerio
force-pushed
the
fix/async_streaming_bugs
branch
3 times, most recently
from
May 31, 2024 06:46
d0366b3
to
42e13a2
Compare
…ufferwriter in StartStreamValueScopeAsync
ElizabethOkerio
force-pushed
the
fix/async_streaming_bugs
branch
from
June 3, 2024 03:44
d9538db
to
b9ed641
Compare
habbes
reviewed
Jun 3, 2024
habbes
previously approved these changes
Jun 3, 2024
gathogojr
reviewed
Jun 3, 2024
src/Microsoft.OData.Core/Json/ODataUtf8JsonWriter.TextWriter.cs
Outdated
Show resolved
Hide resolved
gathogojr
reviewed
Jun 3, 2024
gathogojr
reviewed
Jun 3, 2024
src/Microsoft.OData.Core/Json/ODataUtf8JsonWriter.TextWriter.cs
Outdated
Show resolved
Hide resolved
gathogojr
reviewed
Jun 3, 2024
gathogojr
reviewed
Jun 3, 2024
src/Microsoft.OData.Core/Json/ODataUtf8JsonWriter.TextWriter.cs
Outdated
Show resolved
Hide resolved
gathogojr
reviewed
Jun 3, 2024
src/Microsoft.OData.Core/Json/ODataUtf8JsonWriter.TextWriter.cs
Outdated
Show resolved
Hide resolved
gathogojr
reviewed
Jun 3, 2024
src/Microsoft.OData.Core/Json/ODataUtf8JsonWriter.TextWriter.cs
Outdated
Show resolved
Hide resolved
gathogojr
reviewed
Jun 3, 2024
test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonWriterAsyncTests.cs
Show resolved
Hide resolved
gathogojr
approved these changes
Jun 3, 2024
habbes
approved these changes
Jun 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues
This pull request fixes #xxx.
Description
This PR fixes a bug in the ODataUtf8JsonWriter's
StartStreamValueScopeAsync
where the contents of the utf8jsonwriter are not committed to the buffer before writing stream content to the buffer directly. This leads to content previously written by the utf8jsonwriter being overwritten which leads to corrupt data. Committing utf8jsonwriter's content to buffer before streaming data to the buffer directly fixes this issue.The PR also has logic to add support for float.PositiveInfinity ( -> "INF"), float.NegativityInfinity (-> "-INF") and float.NaN(->"NaN") to ODataUtf8JsonWriter. Support was already there for double, but not float(an exception would be thrown whenUtf8JsonWritertries to writefloat.NaN` for example)
The ODataUtf8JsonWriter.TextWriter did not override Write(char), This PR has changes to override both TextWriter.Write(char) and TextWriter.WriteAsync(char).
Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.