Skip to content

Close zip stream file handle on simulated failure#214

Merged
GrahamCampbell merged 1 commit intomainfrom
close-zip-stream-filehandle
Apr 30, 2026
Merged

Close zip stream file handle on simulated failure#214
GrahamCampbell merged 1 commit intomainfrom
close-zip-stream-filehandle

Conversation

@GrahamCampbell
Copy link
Copy Markdown
Contributor

Minor resource leak in the tests.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a minor file-handle resource leak in the zip-service unit tests by ensuring the simulated failing read stream closes the underlying FileHandle.

Changes:

  • Close the FileHandle when the mocked PassThrough stream errors.
  • Use readStream.destroy(err) (async via nextTick) to simulate stream failure more like Node streams do.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GrahamCampbell GrahamCampbell merged commit 499f1db into main Apr 30, 2026
8 checks passed
@GrahamCampbell GrahamCampbell deleted the close-zip-stream-filehandle branch April 30, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants