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

[BUG] readable stream part of CsvFormatterStream is in objectMode #319

Closed
1 of 2 tasks
AdriVanHoudt opened this issue Jan 21, 2020 · 3 comments
Closed
1 of 2 tasks
Assignees

Comments

@AdriVanHoudt
Copy link

AdriVanHoudt commented Jan 21, 2020

Describe the bug
The whole CsvFormatterStream is set in objectMode while this is only used for the writable part and not the readable part.

Atm this breaks for me as I can't pass CsvFormatterStream to hapi as it doesn't allow me pass a stream in objectMode (https://hapi.dev/api/?v=19.0.5#lifecycle-methods)

Parsing or Formatting?

  • Formatting
  • Parsing

To Reproduce
Atm I'm solving it like this: https://github.com/Salesflare/hapi-csv/blob/cors-and-lifecycle-fix/lib/index.js#L118
Which is forcing the readableStream off objectMode, which seems to work fine.
I also can't pass formatterOptions.objectMode as false as it will set the writable stream off of objectMode as well.

Expected behavior
It doesn't set the readable stream in object mode (or at least has a config for this)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. MacOS] macOS
  • OS Version [e.g. Mojave] 10.15.2 Catalina
  • Node Version [e.g. 10.16.0] 12.14.0

Additional context
Add any other context about the problem here.

@kanongil
Copy link

I expect this can be fixed by changing

super({ objectMode: formatterOptions.objectMode });

to

super({ writableObjectMode: formatterOptions.objectMode });

doug-martin added a commit that referenced this issue Feb 14, 2020
* When formatting only set writableObjectMode
@doug-martin
Copy link
Contributor

doug-martin commented Feb 14, 2020

@kanongil Thank you for the including the fix!

The is will be included in v4.0.3

doug-martin added a commit that referenced this issue Feb 14, 2020
@doug-martin doug-martin mentioned this issue Feb 14, 2020
@doug-martin
Copy link
Contributor

published!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants