fix: harden pull batch downloads and CLI argument parsing against read errors - #36
Open
adi-IL wants to merge 1 commit into
Open
fix: harden pull batch downloads and CLI argument parsing against read errors#36adi-IL wants to merge 1 commit into
adi-IL wants to merge 1 commit into
Conversation
Author
|
Hi @OndrejDrapalik, when you get a chance, could you take a look at this one? It prevents a single unreadable or removed file from aborting the whole |
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.
During project download batches,
sandbox.files.readis executed across files insidePromise.all. If any file in the batch fails to read (for example, due to broken symlinks, locked files, FIFO pipes, or files deleted in the sandbox between status inspection and download), the unhandled rejection rejects the entire batchPromise.all, aborts all subsequent batches, and crashes the pull command.Similarly, CLI invocation of
download.jspassed unvalidated JSON intoJSON.parse, dumping an unhandledSyntaxErrorstack trace instead of exiting cleanly with code 2.This change:
main()andcheckmode intry/catchblocks, safely recording unreadable or unwriteable files intoskippedso the remainder of the batch and subsequent batches complete.try/catchvalidation around CLI JSON parsing insrc/download.jsto exit with code 2 and a clean error message.test/download.test.jsfor invalid CLI JSON arguments and missing parameters.Tests