Repository navigation
feat!: update OkHttp to 5.5.1 - #117
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 2, 2026 15:09
tanderson-ld
commented
Nov 2, 2026
| 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 |
Contributor
Author
There was a problem hiding this comment.
For reviewers: the default download timeout Gradle's 7.6+ wrapper template writes when the wrapper is regenerated via the wrapper task
tanderson-ld
commented
Nov 2, 2026
Contributor
Author
There was a problem hiding this comment.
For reviewers: autogenerated
tanderson-ld
commented
Nov 2, 2026
Contributor
Author
There was a problem hiding this comment.
For reviewers: autogenerated
kinyoklion
approved these changes
Nov 3, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
build.gradle.kts. The 2021 rationale for applying the Kotlin plugin (theapi-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)
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.com.squareup.okhttp3:okhttpas 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 resolvedokhttp-jvm:5.5.1coordinates into our pom — the only functional choice for Maven-only consumers. The tradeoff: a project that also pinsokhttp:4.xelsewhere 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 declaresokhttp:5.5.1, and normal version conflict resolution applies.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.okhttp-jvm:5.5.1; no kotlin-stdlib leak (still guarded bykotlin.stdlib.default.dependency=false).okhttp:5.5.1.Adoption notes for our own SDKs
The LaunchDarkly Java and Android SDKs pin their own direct
okhttp4.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,networkTimeouton the wrapper). Thebuild.gradle.ktscomment is rewritten to document why the Kotlin plugin must stay: published Maven POMs need resolvedokhttp-jvmcoordinates instead of the empty OkHttp 5okhttpstub 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.