Skip to content

feat!: update OkHttp to 5.5.1 - #117

Merged
tanderson-ld merged 1 commit into
mainfrom
feat/okhttp-5
Nov 3, 2026
Merged

tanderson-ld merged 1 commit into
mainfrom
feat/okhttp-5

Conversation

@tanderson-ld

@tanderson-ld tanderson-ld commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updates OkHttp from 4.12.0 to 5.5.1. This supersedes #104 — thanks @marcindabrowski for getting it started. The version bump itself is one line, but shipping OkHttp 5 correctly required three more changes:

  • Kotlin Gradle plugin 1.6.10 → 2.1.21, matching the Kotlin version OkHttp 5.5.1 is built with (per the kotlin-stdlib dependency in okhttp-jvm's pom).
  • Gradle wrapper 7.6 → 7.6.3, the minimum version the Kotlin plugin 2.1.x accepts (it hard-fails on 7.6).
  • Rewrote the plugins-block comment in build.gradle.kts. The 2021 rationale for applying the Kotlin plugin (the api-configuration workaround) no longer holds — the build passes without the plugin on Gradle 7.6+. But the plugin is now load-bearing for a different reason, documented in the new comment and below, so it must stay.

Why this is a breaking change (6.0.0)

  • OkHttp types appear in this library's public API (ConnectStrategy.http() / HttpConnectStrategy), so OkHttp's major version is part of our contract. Precedent: the OkHttp 3→4 move shipped as okhttp-eventsource 2.0.0.
  • Maven consumers will see a coordinate change. OkHttp 5.x publishes com.squareup.okhttp3:okhttp as an empty Kotlin Multiplatform stub (a 754-byte jar whose pom does not reference the real JVM artifact); only Gradle consumers can resolve it via module metadata. With the Kotlin plugin applied, Gradle writes the resolved okhttp-jvm:5.5.1 coordinates into our pom — the only functional choice for Maven-only consumers. The tradeoff: a project that also pins okhttp:4.x elsewhere in its dependency graph can end up with both jars on the classpath (duplicate classes), since Maven cannot conflict-resolve across different artifact IDs. Gradle consumers are unaffected — our module metadata still declares okhttp:5.5.1, and normal version conflict resolution applies.
  • New transitive dependencies: kotlin-stdlib 2.1.21 and okio 3.18.1.
  • Platform floors unchanged: Java 8+, Android 5.0+ (API 21+).

Verification (local, JDK 17)

  • ./gradlew build: compile, checkstyle, javadoc, and all 233 unit tests green. No source changes were needed — OkHttp 5 is binary- and source-compatible for the surface this library uses.
  • make contract-tests: all SSE contract tests pass.
  • Generated pom inspected: depends on okhttp-jvm:5.5.1; no kotlin-stdlib leak (still guarded by kotlin.stdlib.default.dependency=false).
  • Generated Gradle module metadata inspected: declares okhttp:5.5.1.
  • Not yet exercised locally: the Java 8 and Windows CI lanes — watch those on this PR.

Adoption notes for our own SDKs

The LaunchDarkly Java and Android SDKs pin their own direct okhttp 4.x dependency alongside okhttp-eventsource. When they adopt 6.0.0, they should bump their own OkHttp to 5.x in the same release to avoid the mixed-graph duplicate-class hazard described above. Releasing 6.0.0 forces nothing on existing consumers; the 5.x line keeps working.


Note

Overview
Bumps the transport dependency from OkHttp 4.12.0 to 5.5.1 with no Java source edits in this diff—build and publishing/docs only, intended as a 6.0.0 breaking release because OkHttp types are exposed on the public API (ConnectStrategy / HttpConnectStrategy).

Build toolchain: Kotlin Gradle plugin 1.6.10 → 2.1.21 (aligned with OkHttp 5’s Kotlin version), Gradle wrapper 7.6 → 7.6.3 plus wrapper script refresh (gradlew / gradlew.bat, networkTimeout on the wrapper). The build.gradle.kts comment is rewritten to document why the Kotlin plugin must stay: published Maven POMs need resolved okhttp-jvm coordinates instead of the empty OkHttp 5 okhttp stub so Maven-only consumers get real classes.

README now states 6.0+ uses OkHttp 5.x (2.0–5.x stayed on 4.x). Consumers should expect new transitives (e.g. kotlin-stdlib, okio) and possible Maven dependency-graph quirks if they still pin OkHttp 4.x elsewhere.

Reviewed by Cursor Bugbot for commit afc39fd. Bugbot is set up for automated code reviews on this repo. Configure here.

BREAKING CHANGE: The OkHttp dependency is updated from 4.12.0 to 5.5.1.
OkHttp types are part of this library's public API. The published pom now
references okhttp-jvm, OkHttp 5.x's JVM artifact, instead of okhttp; the
Gradle module metadata still declares okhttp. Transitive dependencies are
now kotlin-stdlib 2.1.21 and okio 3.18.1. Supported platform versions are
unchanged: Java 8+ and Android 5.0+ (API 21+).

Co-authored-by: Marcin Dąbrowski <marcin.krzysztof.dabrowski@gmail.com>
@tanderson-ld
tanderson-ld marked this pull request as ready for review November 2, 2026 15:09
@tanderson-ld
tanderson-ld requested a review from a team as a code owner November 2, 2026 15:09
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
networkTimeout=10000

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: the default download timeout Gradle's 7.6+ wrapper template writes when the wrapper is regenerated via the wrapper task

Comment thread gradlew

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: autogenerated

Comment thread gradlew.bat

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: autogenerated

@tanderson-ld
tanderson-ld merged commit 6cc4a9a into main Nov 3, 2026
18 of 19 checks passed
@tanderson-ld
tanderson-ld deleted the feat/okhttp-5 branch November 3, 2026 15:36
tanderson-ld pushed a commit that referenced this pull request Nov 3, 2026
🤖 I have created a release *beep* *boop*
---


##
[6.0.0](5.0.2...6.0.0)
(2026-11-03)


### ⚠ BREAKING CHANGES

* update OkHttp to 5.5.1
([#117](#117))

### Features

* update OkHttp to 5.5.1
([#117](#117))
([6cc4a9a](6cc4a9a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> Release Please **6.0.0** prep: bumps the library version from
**5.0.2** to **6.0.0** in `gradle.properties` and
`.release-please-manifest.json`, and adds the **6.0.0** section to
`CHANGELOG.md`.
> 
> The changelog records the headline change for this major release—a
**breaking** bump of the OkHttp dependency to **5.5.1**
([#117](https://github.com/launchdarkly/okhttp-eventsource/issues/117))—which
was already merged; this PR is the version/changelog cut, not the
dependency change itself.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
203dd08. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@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.

2 participants