Skip to content

Commit 89baf57

Browse files
committed
fix: replace @eggjs/yauzl with upstream yauzl 3.4.0
The fork depends on fd-slicer2, whose ReadStream loses data when piped on Node.js 26: any zip entry over 64 KiB delivers roughly the first chunk and then stalls with no end, no error, and no close. That is why zip.uncompress() hangs until the test timeout on Node 26 while passing on 18 through 24. Upstream yauzl 3.4.0 dropped fd-slicer entirely, its only dependency now being pend, and does not have the bug. Verified identical behaviour on the contain-absolute-path.zip fixture that motivated the fork in the first place: 31 entries, Buffer fileNames under decodeStrings:false, externalFileAttributes intact, and the leading "/" entry still read. Suite is 171 passing on both Node 24 and Node 26. The only visible difference is that yauzl 3.x capitalises the "end of central directory record signature not found" message, so that assertion is now case-insensitive. Reported upstream at node-modules/yauzl#3.
1 parent cf41125 commit 89baf57

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/zip/uncompress_stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// https://github.com/thejoshwolfe/yauzl#no-streaming-unzip-api
44

55
const debug = require('util').debuglog('compressing/zip/uncompress_stream');
6-
const yauzl = require('@eggjs/yauzl');
6+
const yauzl = require('yauzl');
77
const stream = require('stream');
88
const UncompressBaseStream = require('../base_write_stream');
99
const utils = require('../utils');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"homepage": "https://github.com/node-modules/compressing#readme",
4141
"dependencies": {
42-
"@eggjs/yauzl": "^2.11.0",
42+
"yauzl": "^3.4.0",
4343
"flushwritable": "^1.0.0",
4444
"get-ready": "^1.0.0",
4545
"iconv-lite": "^0.5.0",

test/zip/uncompress_stream.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('test/zip/uncompress_stream.test.js', () => {
5252
const uncompressStream = new compressing.zip.UncompressStream();
5353
await assert.rejects(async () => {
5454
await pipelinePromise(fs.createReadStream(sourceFile), uncompressStream);
55-
}, /end of central directory record signature not found/);
55+
}, /end of central directory record signature not found/i);
5656
});
5757

5858
it('should uncompress according to file path', done => {

0 commit comments

Comments
 (0)