Skip to content

feat(core): split the updateBuild request to avoid PayloadTooLargeError - #327

Merged
gregberge merged 2 commits into
mainfrom
greg/arg-430-split-the-upload-request-to-avoid-payloadtoolargeerror
Jun 29, 2026
Merged

gregberge merged 2 commits into
mainfrom
greg/arg-430-split-the-upload-request-to-avoid-payloadtoolargeerror

Conversation

@gregberge

@gregberge gregberge commented Jun 28, 2026 •

Copy link
Copy Markdown
Member

Why

A build sent all of its screenshot metadata in one updateBuild request. Once a suite grows large, that body can exceed the API's request body size limit and fail with PayloadTooLargeError, since per-screenshot metadata (test info, annotations, tags, URLs…) can be sizeable. (See ARG-430.)

What

Split a build's screenshots across several sequential updateBuild requests, each byte-budgeted to stay under the limit (chunkBySize, < 2MB):

  • Single builds: chunks target the same build; the last request is final: true and carries the build metadata.
  • Parallel, indexed shard: chunks group into a single shard (same parallelIndex), only the last is final.
  • Parallel, index-less shard (manual finalization): can't be grouped, so each chunk is sent as its own complete shard — fine since the build is finalized manually.

Build metadata is sent on the last chunk only in every case. api-client's schema.ts is regenerated to expose the new final field.

Requires the matching backend change (argos greg/arg-430-...), which must ship first.

Tests

chunkBySize unit tests (size splitting, oversized item, empty) and an integration test asserting the update request is marked final and carries the metadata. Types + lint clean.

🤖 Generated with Claude Code

A single (non-parallel) build sent all of its screenshot metadata in one
`updateBuild` request, which could exceed the API request body size limit
(PayloadTooLargeError) once a suite grew large, since per-screenshot
metadata can be sizeable.

Split a non-parallel build's screenshots across several sequential
`updateBuild` requests sized to stay under the limit. The build is
finalized by the last request (`final: true`), which also carries the
build metadata. Parallel shards keep sending a single request each, since
every request counts as one batch.

Regenerate the api-client types to expose the new `final` field.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 28, 2026

Copy link
Copy Markdown

ARG-430

@vercel

vercel Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
argos-js-sdk-reference Ready Ready Preview, Comment Jun 28, 2026 9:10pm

Request Review

@gregberge
gregberge requested review from Copilot and jsfez June 28, 2026 20:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Extend request splitting to parallel builds. An indexed shard groups its
chunks into a single shard (only the last request is `final`); an index-less
shard (manual finalization) can't be grouped, so each chunk is sent as its
own complete shard, which is fine since the build is finalized manually.
Build metadata is sent on the last chunk only either way.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gregberge
gregberge merged commit 01defb7 into main Jun 29, 2026
68 checks passed
@gregberge
gregberge deleted the greg/arg-430-split-the-upload-request-to-avoid-payloadtoolargeerror branch June 29, 2026 06:59

This branch was successfully deployed

1 active deployment
Preview — 4a71d679 Deployed Jun 28, 2026 by vercel[bot]
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.

2 participants