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(typescript): avoid parsing empty messageTerminators in JSON stream case. #5471

Merged
merged 3 commits into from
Dec 23, 2024

Conversation

eyw520
Copy link
Member

@eyw520 eyw520 commented Dec 23, 2024

Description

Our Stream.ts logic currently breaks when the JSON event stream ends in a messageTerminator, leading to an empty string that, when parsed as JSON, results in a parse error.

This fix 1) better checks for complex messageTerminator patterns and 2) performs a better check for empty lines.

Changes Made

  • Update Stream.ts with two changes to parsing logic.

Testing

  • Unit tests added/updated
  • Manual testing completed

@eyw520 eyw520 requested a review from dsinghvi as a code owner December 23, 2024 17:13
@eyw520 eyw520 merged commit 0883bb0 into main Dec 23, 2024
49 checks passed
@eyw520 eyw520 deleted the eden/update-ts-stream-utils branch December 23, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants