Skip to content

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

@mgroenhoff

Description

@mgroenhoff

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions