Skip to content

fix(npm): close download streams in postinstall (GH#3205)#3228

Merged
maphew merged 1 commit into
gastownhall:mainfrom
zerone0x:fix/windows-postinstall-stream-lock-3205
Apr 13, 2026
Merged

fix(npm): close download streams in postinstall (GH#3205)#3228
maphew merged 1 commit into
gastownhall:mainfrom
zerone0x:fix/windows-postinstall-stream-lock-3205

Conversation

@zerone0x

Copy link
Copy Markdown
Contributor

Summary

  • close response/request and file handle on redirects or non-200 downloads
  • destroy response after successful file close and close file on response errors
  • open zip with r+ in waitForFileAccess to detect Windows write locks

Fixes #3205.

Testing

  • not run (not needed for JS-only change)

@maphew maphew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clean, well-targeted fix that addresses all three issues from #3205: stream cleanup on redirects, stream cleanup on success, and the waitForFileAccess open mode. Thanks for the contribution, @zerone0x!

@maphew maphew merged commit b404538 into gastownhall:main Apr 13, 2026
37 checks passed
@maphew

maphew commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

Merged — thank you @zerone0x for the clean fix! All three root causes from #3205 are addressed: stream cleanup on redirects, on success, and the r+ mode for waitForFileAccess. 🎉

osamu2001 pushed a commit to osamu2001/beads that referenced this pull request Apr 13, 2026
Close response/request streams and file handles on redirects and non-200 downloads.
Destroy response after successful file close. Open zip with r+ in waitForFileAccess
to detect Windows write locks.

Fixes gastownhall#3205.

Co-authored-by: zerone0x <hi@trine.dev>
mzlee pushed a commit to mzlee/beads that referenced this pull request Apr 22, 2026
Close response/request streams and file handles on redirects and non-200 downloads.
Destroy response after successful file close. Open zip with r+ in waitForFileAccess
to detect Windows write locks.

Fixes gastownhall#3205.

Co-authored-by: zerone0x <hi@trine.dev>
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.

npm install -g @beads/bd fails on Windows — postinstall.js response stream leak causes zip extraction to fail despite retry logic

2 participants