Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #116.
When the entry stream errors before the output file's
fs.opencallback completes, extraction closes the closure-scoped archive descriptor (fd) instead of the output descriptor (fdFile). The output remains open and a laterzip.close()attempts to close the archive descriptor a second time.Change that error branch to close
fdFile.The regression uses the existing corrupt-entry fixture and
StreamZip.setFsto hold the output-open callback until the real entry stream emits its error. It checks that the original error reaches the extraction callback, only the output descriptor is closed at that point, and the archive can still be closed normally. It does not depend on a timer or filesystem speed, and restores the filesystem hook after the test.Validation:
npm run lint,npm run check-types, andgit diff --checkpass.callback exceptiontest. That unrelated behavior is not changed here; full-suite results above are for Node 25, matching this repository's CI configuration.Only the one-line descriptor fix and regression test are included. No dependency, type declaration, or formatting-only changes. Both published files at head 03c88a8 were compared byte-for-byte with the tested files through a fresh clone. CI results are not yet known.