Closed
Description
Version
20.16.0
Platform
UNIX & Windows
Subsystem
No response
What steps will reproduce the bug?
I use he archiver from package "archiver": "^7.0.1"
and try to archive some files to a stream. I use finished function to wait for the stream completed.
import archiver from 'archiver';
import * as memoryStream from 'memory-streams';
import * as streamPromise from 'stream/promises';
function dosomething() {
const highWaterMark = 8 * 1024 * 1024;
const zipStream = new memoryStream.WritableStream({
emitClose: true,
autoDestroy: true,
highWaterMark: highWaterMark
});
const zipArchiver = archiver.create('zip', {
zlib: {
level: 9
},
highWaterMark: highWaterMark
});
zipArchiver.pipe(zipStream);
zipArchiver.on('error', (err) => {
// Print error
});
zipArchiver.on('warning', (err) => {
// Print warning
});
// Append some entries to the archive
zipArchiver.append(/*<ReadableStream or buffer>*/, {
name: 'test',
date: new Date()
});
await zipArchiver.finalize();
// Node.js v20.13.1 this function will return
// Node.js v20.16.0 this function will never return
await streamPromise.finished(zipStream);
}
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
finished should behave as the Nodejs v20.13.1
What do you see instead?
finished never returns
Additional information
No response