Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

2.13.1 doesn't play with JSONStream #671

Closed
amsross opened this issue Feb 19, 2019 · 3 comments
Closed

2.13.1 doesn't play with JSONStream #671

amsross opened this issue Feb 19, 2019 · 3 comments

Comments

@amsross
Copy link
Contributor

amsross commented Feb 19, 2019

Here is some example code:

const { parse } = require('JSONStream')
const h = require('highland')

h.log('start')
h.of(JSON.stringify({ 'foo': 'bar' }))
  .through(parse())
  .done(() => h.log('done'))

With the following versions, this code logs "start", then exits:

  • highland@2.13.1
  • JSONStream@1.3.5

With the following versions, this code logs "start", then "done", then exits:

  • highland@2.13.0
  • JSONStream@1.3.5

Further testing is needed on my part to expose some useful details, but I think this is worth opening as-is for the time being.

@vqvu
Copy link
Collaborator

vqvu commented Feb 20, 2019

Sorry about this. The fix for #670 caused some collateral damage. through used to pause the target stream. The fix stopped doing that to fix an incompatibility with node 0.10, but caused this a regression.

Basically, through is implemented in terms of pipe. In 2.x, pipe can synchronously push data through, which can cause data loss if the through stream is un-paused. I will update pipe so that it always pushes data asynchronously.

@vqvu vqvu closed this as completed in 9fc7824 Feb 20, 2019
@vqvu
Copy link
Collaborator

vqvu commented Feb 20, 2019

This should be fixed in 2.13.3.

@amsross
Copy link
Contributor Author

amsross commented Feb 20, 2019

Awesome, thanks for the quick response!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants