Skip to content
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 overaggressive escaping #8054

Merged
merged 7 commits into from
Apr 10, 2024
Merged

Fix overaggressive escaping #8054

merged 7 commits into from
Apr 10, 2024

Conversation

scbedd
Copy link
Member

@scbedd scbedd commented Apr 10, 2024

Certain symbols like + and & within json shouldn't be escaped to their unicode equivalents.

After a bunch of flipping back and forth in the tests, I finally get what was going on. At some point in the history here, we used NewtonSoft.Json as the primary serializer/deserializer package. IIRC, "combining" writers to write into your stream was a supported feature.

The code path that was removed in this PR was the remnants of that feature, and the source of the bug. I could modify the RecordEntry JsonWriterOptions / Encoder to my heart's content, but that change would never actually affect the output. This PR simply shares the encoder used in RecordEntry with RecordingHandler while writing to disk, eliminating the last mile escaping issues.

New recordings should get the benefit, and old ones won't have any issues from disk.

@scbedd scbedd self-assigned this Apr 10, 2024
@scbedd scbedd requested a review from mikeharder as a code owner April 10, 2024 00:53
@scbedd scbedd merged commit 65f5db5 into main Apr 10, 2024
12 checks passed
@scbedd scbedd deleted the investigate-encoding-unicode branch April 10, 2024 16:36
@scbedd scbedd mentioned this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants