Currently, pipeline and eos does not take into account whether the streams are "valid" or not to begin with.
Consider this potentially common example:
await mkdirp(path); // async stuff
assert(req.aborted); // aborted by client
const dst = fs.createWriteStream(path);
pipeline(req, dst, common.mustCall(err => {
assert(err != null);
}));
or less common
const dst = fs.createWriteStream(path);
await doAsyncStuff();
assert(dst.destroyed);
pipeline(req, dst, common.mustCall(err => {
assert(err != null);
}));
This will fail... even though I believe it should error with a premature close (or something similar)?
Basically eos and pipeline makes assumptions of the arguments which are not enforced...
Currently,
pipelineandeosdoes not take into account whether the streams are "valid" or not to begin with.Consider this potentially common example:
or less common
This will fail... even though I believe it should error with a premature close (or something similar)?
Basically
eosandpipelinemakes assumptions of the arguments which are not enforced...