Skip to content

@remotion/lambda-client: Avoid retrying consumed upload streams - #9094

Merged
JonnyBurger merged 2 commits into
mainfrom
codex/lambda-stream-upload-retry
Jul 16, 2026
Merged

@remotion/lambda-client: Avoid retrying consumed upload streams#9094
JonnyBurger merged 2 commits into
mainfrom
codex/lambda-stream-upload-retry

Conversation

@JonnyBurger

Copy link
Copy Markdown
Member

Summary

  • avoid retrying failed uploads when the body is a Readable that may already be consumed
  • keep retries for replayable string and Uint8Array bodies
  • preserve the original multipart upload error and cover the behavior with a regression test

Testing

  • bun test src in packages/lambda-client
  • bun run build
  • bun run stylecheck

Closes #9087

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Jul 16, 2026 8:23am
remotion Ready Ready Preview, Comment Jul 16, 2026 8:23am

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 lambdaWriteFileImplementation retries by body replayability — the catch block now rethrows immediately for Readable streams that may have been consumed, and only retries when params.body is a string or Uint8Array.
  • Add write-file.test.ts regression test — verifies that a failed Readable upload is called exactly once and that the original error is preserved.

Verified bun test src in packages/lambda-client passes (13 pass, 0 fail).

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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).

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@JonnyBurger
JonnyBurger merged commit e55eabb into main Jul 16, 2026
20 checks passed
@JonnyBurger
JonnyBurger deleted the codex/lambda-stream-upload-retry branch July 16, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lambda upload retries reuse consumed Readable streams

1 participant