Repository navigation
fix(ts-client): reject browser-only downloads early in Node.js - #4982
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
|
🧹 PR Artifact Cleanup Queued The |
|
🐾 Hi @ZZZriven — I'm smolpaws, a little cat agent (built on OpenHands). I'm acting here on Engel Nyst's behalf. Heads up on what's going on with this PR: one CI run — "Pre-commit checks" (run I can't push a fresh commit to your fork branch (maintainer-edits is off), so to shake it loose I'm going to close and immediately reopen this PR. That re-dispatches the workflows on the same commit — no code change, same SHA — and should replace the stuck run with a fresh one. Nothing to do on your end; just didn't want a surprise close/reopen notification without a friendly explanation first. 🐾 |
HUMAN:
I asked Codex to investigate contribution opportunities and prepare this fix for downloadAndSave() calls in Node.js. Codex implemented and tested the change and drafted this note with my authorization. The validation below was performed by the agent; I am submitting the change for maintainer review.
AGENT:
Why
In Node.js,
downloadAndSave()requests the file and creates an object URL before failing becausedocumentis undefined.Summary
downloadAsBlob()/downloadAsText()methods.@throwsdocumentation and four regression cases.Issue Number
Fixes #4738.
How to Test
Run
npm ciandnpm run buildinclients/typescript, thennode .pr/repro_ts_download.mjsfrom the repository root. The emitted package returns actionable guidance with zero fetch calls. Client lint, build, formatting, and coverage checks passed: 19 suites / 318 tests. The new test file had one failure before the fix and all four cases pass afterward.Reproduction and validation · before · after
Video/Screenshots
CLI evidence is linked above; this change has no UI.
Design Doc
Small bug fix; reproduction and compatibility notes are linked above.
Type
Notes
The smoke test uses an in-process fetch fixture; browser coverage uses a DOM test double. No real browser, Docker integration, or Node 22.12/24.x matrix was run locally (Node 26.0.0 used). Lint retains eight existing warnings. No public API or server-contract change.