@remotion/lambda-client: Avoid retrying consumed upload streams - #9094
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the PR stops retrying failed S3 uploads when the body is a non-replayable Readable, while preserving retries for string and Uint8Array bodies and adding a regression test to guard against silent empty-stream retries.
- Scope
lambdaWriteFileImplementationretries by body replayability — the catch block now rethrows immediately forReadablestreams that may have been consumed, and only retries whenparams.bodyis astringorUint8Array. - Add
write-file.test.tsregression test — verifies that a failedReadableupload is called exactly once and that the original error is preserved.
Verified bun test src in packages/lambda-client passes (13 pass, 0 fail).
Kimi K2 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the follow-up commit adds inline comments to the stream retry guard in lambdaWriteFileImplementation, documenting why non-replayable Readable bodies are not retried.
- Add explanatory comment to the retry branch — clarifies that retrying a consumed stream can upload an empty body and mask the original multipart upload error.
Verified bun test src in packages/lambda-client still passes after the latest commit (13 pass, 0 fail).
Kimi K2 (free via Pullfrog for OSS) | 𝕏

Summary
Readablethat may already be consumedUint8ArraybodiesTesting
bun test srcinpackages/lambda-clientbun run buildbun run stylecheckCloses #9087