Skip to content

fix(postinstall): keep failed downloads out of the binary path - #2470

Open
xunguangzlj-cloud wants to merge 2 commits into
vercel-labs:mainfrom
xunguangzlj-cloud:fix/atomic-postinstall-download
Open

xunguangzlj-cloud wants to merge 2 commits into
vercel-labs:mainfrom
xunguangzlj-cloud:fix/atomic-postinstall-download

Conversation

@xunguangzlj-cloud

Copy link
Copy Markdown

Problem

A failed native binary download can leave an empty or partial file at the install path. The next postinstall sees that file and skips the download.

Change

Stream the response to a temporary file in the binary directory. Move it into place after the stream finishes and the file has content. Clean up the temporary file if the request or write fails.

Verification

  • Reproduced the stale file on the base commit with an HTTP 404, an interrupted response, and an empty HTTP 200 response.
  • Each regression retries through an HTTP redirect and verifies that the final file contains the complete response.
  • All seven launcher and postinstall tests passed on Node 24.16.0 under Ubuntu. The three postinstall cases also passed on Windows. The tests use a loopback server and a temporary package directory.
  • The version sync and diff checks passed.

Authored with OpenAI Codex (GPT-6).

@vercel

vercel Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

@xunguangzlj-cloud is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant