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

dest() result stream does not end when writing a stream using Node 9 #295

Closed
mgroenhoff opened this issue Jan 17, 2018 · 1 comment
Closed

Comments

@mgroenhoff
Copy link

When writing a stream (file.isStream() return true) using vfs.dest() the resulting stream will never end. I did some digging and it seems the code inside file-operations.js is out of date with when compared to Node 9.

The issue is on the folowing line:

// Dispose on finish.
this.once('finish', this.close);

When i compare this to Node 9:
https://github.com/nodejs/node/blob/8c00a809bc08d87776f74c84751607155f3df61f/lib/fs.js#L2462-L2467

It calls destroy instead of close (which btw is not even part of the public API). When i change it to this.once('finish', this.destroy); (like Node does) everything seems to works fine.

@phated
Copy link
Member

phated commented Jan 17, 2018

As I stated in the other thread:

unfortunately, we don't support node 9 because the node team doesn't seem to care that they keep breaking userland.

The logic you are referencing was pulled out of an LTS version of node and has worked across all versions until 9. We can't keep bending to node-core's whim when we also have to think about backwards compat.

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

No branches or pull requests

2 participants