Skip to content

fix: Make batch_add_requests split batches by serialized payload size#953

Open
vdusek wants to merge 3 commits into
masterfrom
fix/batch-add-requests-payload-size
Open

fix: Make batch_add_requests split batches by serialized payload size#953
vdusek wants to merge 3 commits into
masterfrom
fix/batch-add-requests-payload-size

Conversation

@vdusek

@vdusek vdusek commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The 9 MB payload guard in batch_add_requests was inert: constrained_batches was called without get_len, so the default len() measured each request dict's key count (~4) instead of its serialized size. Batches were therefore split only by the 25-request count limit, and large requests shipped as one oversized POST that the API rejects with 413, failing the whole call.

The guard now measures each request as its UTF-8 JSON byte length, using the same serialization flags as the HTTP client's request body path. It also passes strict=False, which preserves the previous contract for an individually oversized request: it's sent in its own batch and left for the API to judge, instead of raising a client-side ValueError. Both the size-based splitting and the oversized-singleton path are covered by new sync/async regression tests.

🤖 Generated with Claude Code

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Jul 16, 2026
@vdusek vdusek self-assigned this Jul 16, 2026
@github-actions github-actions Bot added this to the 145th sprint - Tooling team milestone Jul 16, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.60%. Comparing base (a8a393b) to head (01494f4).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #953      +/-   ##
==========================================
- Coverage   94.61%   94.60%   -0.02%     
==========================================
  Files          58       58              
  Lines        5239     5242       +3     
==========================================
+ Hits         4957     4959       +2     
- Misses        282      283       +1     
Flag Coverage Δ
integration 92.40% <100.00%> (-0.27%) ⬇️
unit 83.74% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek requested a review from Pijukatel July 16, 2026 13:49
@vdusek vdusek marked this pull request as ready for review July 16, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants