Skip to content

fix(java): send request bodies with Content-Length instead of chunked encoding - #7069

Merged
Fluf22 merged 1 commit into
mainfrom
fix/java-fixed-content
Sep 18, 2026
Merged

Fluf22 merged 1 commit into
mainfrom
fix/java-fixed-content

Conversation

@Fluf22

@Fluf22 Fluf22 commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

🧭 What and Why

🎟 JIRA Ticket: CR-12179 (same wire-level issue as API-141 / #6832)

The Java client streamed JSON request bodies without a known length, so OkHttp sent them with Transfer-Encoding: chunked. After the v3→v4 flip that showed up as extra client-observed latency (TCP delayed ACK on incomplete chunked POSTs). This ports the Scala fix: buffer the JSON and send Content-Length in one write. Gzip stays chunked on purpose.

🧪 Test

Manual CTS pins UTF-8 body length and bodyless POST {} at length 2, matching the Scala contract.

@algolia-api-clients-automation-bot

algolia-api-clients-automation-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

💥 Breaking changes detected !!

Either this PR or a previous PR not released yet introduced breaking changes, be careful when merging.
You can find the details in the 'client java@21' CI job.

✔️ Code generated!

Name Link
🪓 Triggered by ecdad0952aed3094458df0beb7b63b6eac5df464
🍃 Generated commit 7b37f7b3e75f1ed8a7662d1dbe417735e6fbba17
🌲 Generated branch generated/fix/java-fixed-content
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
java 1011

@aikido-pr-checks

Copy link
Copy Markdown

Summary by Aikido

Security Issues: 0 Quality Issues: 0 Resolved Issues: 0

🐛 Bugfixes

  • Buffered serialized JSON request bodies, forcing Content-Length instead of chunked encoding

More info

@Fluf22 Fluf22 self-assigned this Sep 18, 2026
@Fluf22
Fluf22 marked this pull request as ready for review September 18, 2026 15:24
@Fluf22
Fluf22 requested a review from a team as a code owner September 18, 2026 15:24
@Fluf22
Fluf22 merged commit f89fe94 into main Sep 18, 2026
20 checks passed
@Fluf22
Fluf22 deleted the fix/java-fixed-content branch September 18, 2026 15:26
algolia-api-clients-automation-bot Bot added a commit that referenced this pull request Sep 18, 2026
… encoding (#7069) (generated) [skip ci]

Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-csharp that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-dart that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-go that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-java that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-kotlin that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-php that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-python that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-ruby that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-scala that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-swift that referenced this pull request Sep 18, 2026
… encoding (generated)

algolia/api-clients-automation#7069

Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
Fluf22 added a commit that referenced this pull request Oct 5, 2026
…ked encoding (#7069)

This reverts commit f89fe94.

Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
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.

1 participant