Skip to content

fix: finish pull batches while reporting per-file failures - #36

Merged
OndrejDrapalik merged 3 commits into
e2b-dev:mainfrom
adi-IL:fix/download-batch-resilience
Sep 7, 2026
Merged

OndrejDrapalik merged 3 commits into
e2b-dev:mainfrom
adi-IL:fix/download-batch-resilience

Conversation

@adi-IL

@adi-IL adi-IL commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

A single unreadable remote file or failed local write could abort the pull batch and prevent later files from downloading. Handle preparation, read and write failures per file so the remaining files and batches finish, while reporting the actual errors and returning exit 1 for an incomplete pull.

Only successful writes count as new or overwritten. Unsafe-path/symlink skips retain their existing meaning. An all-failed pull no longer claims that the local tree matches the box.

The overwrite safety check remains conservative: a failed remote read causes a failed check, so the CLI aborts or prompts rather than treating an unreadable dirty file as safe. Invalid CLI JSON exits cleanly with code 2.

Validation: 17 targeted download tests pass, including five real-CLI scenarios with an isolated temporary git/filesystem fixture and stubbed SDK. Four new regressions failed against the original PR before the correction. Coverage includes transient safety-check failure and retry, explicit force, remote reads and local writes failing across batches, destination preparation errors, all-failed reporting, and normal success/unchanged/unsafe-skip behavior. The full local JavaScript suite passes all 306 tests; the CLI suite has the same two credential-discovery failures reproduced on unchanged main.

@cla-bot cla-bot Bot added the cla-signed label Aug 31, 2026
@adi-IL

adi-IL commented Sep 2, 2026

Copy link
Copy Markdown
Contributor 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 Promise.all download batch during pull, and hardens CLI argument parsing in download.js. All 286 unit and 299 CLI tests pass.

@OndrejDrapalik OndrejDrapalik 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.

The CLI JSON validation is useful, but the new error handling needs two changes before this can merge. Both issues below were reproduced with the real download.js entrypoint, an isolated git fixture, and a stubbed SDK connection. Please also add behavior tests for failed reads/writes and continuation into subsequent batches; the current added tests cover only argument parsing.

Comment thread src/download.js Resolved
Comment thread src/download.js Resolved
@OndrejDrapalik OndrejDrapalik changed the title fix: harden pull batch downloads and CLI argument parsing against read errors fix: finish pull batches while reporting per-file failures Sep 7, 2026

@OndrejDrapalik OndrejDrapalik 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.

Both previously requested changes are fixed in 8778808. Failed safety checks remain conservative; ordinary file failures allow subsequent batches to finish, preserve error reasons, return exit 1, and never count failed writes as successful downloads. The real-CLI regressions cover both blockers and the batch/summary behavior. All 17 targeted tests passed, and fresh CI passed on Node 22/24 across Ubuntu/macOS plus Rust, version and CLA checks.

@OndrejDrapalik
OndrejDrapalik merged commit 6cc81c4 into e2b-dev:main Sep 7, 2026
7 checks passed
@OndrejDrapalik OndrejDrapalik mentioned this pull request Sep 7, 2026
2 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants