-
Notifications
You must be signed in to change notification settings - Fork 21
Add stream result endpoint to JS SDK #122
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
Conversation
javascript/sdk/src/index.ts
Outdated
| if (done) return | ||
|
|
||
| const lines = decoder | ||
| .decode(value) |
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.
Consider handling partial JSON lines: use decoder.decode() with { stream: true } and accumulate unfinished lines across chunks to avoid parsing errors.
| .decode(value) | |
| .decode(value, { stream: true }) |
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.
Good bot, I didn't know about this and it ended up leading me to TextDecoderStream which is really what we want.
3c36428 to
3c493f2
Compare
|
These tests should pass now that https://github.com/jamsocket/forevervm-platform/pull/242 is merged. |
What it says on the tin!