{{ message }}
Conversation
nygrenh
commented
Jun 12, 2026
Member
- Fix CLI download startup crash on VS Code >=1.123
- Harden CLI verification and download error handling
downloadFile() never flushed or closed its write stream (the awaits on write()/close() awaited non-promises), so the small .sha256 file could be read back empty, producing a checksum "mismatch". The recovery path then deleted the cli folder while that file's handle was still open and returned Ok without re-verifying. On Node 24 (VS Code 1.123+) that unflushed-handle delete throws ENOTEMPTY, killing activation.
- utils.ts: stream the download with real backpressure (await drain) and await stream/promises finished() so the data is flushed and the fd closed before returning; destroy the stream on error so no handle leaks.
- ensureLangsUpdated.ts: extract verifyCli(); re-verify the checksum after a redownload (Err on persistent mismatch instead of trusting it); replace del's deleteSync with removeCliFolder() using fs.rm {maxRetries, retryDelay}, returning a Result so a failed delete can't crash activation; harden parseSha256Sum; add an optional opts {downloadUrl, version} for testing.
- Tests: new downloadFile suite (incl. the empty-read regression) and end-to-end ensureLangsUpdated coverage, including the real uppercase+CRLF 0.39.4 checksum format.
- Bump to 3.5.3 + CHANGELOG.
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.
