Skip to content

chore(deps): bump okhttp to v5.3.2 - #104

Closed
marcindabrowski wants to merge 1 commit into
launchdarkly:mainfrom
marcindabrowski:deps/bump-okhttp-v5
Closed

marcindabrowski wants to merge 1 commit into
launchdarkly:mainfrom
marcindabrowski:deps/bump-okhttp-v5

Conversation

@marcindabrowski

@marcindabrowski marcindabrowski commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

v5.3.2 is the latest version of OkHttp.
Version 5 of OkHttp works on Android 5.0+ (API level 21+) and Java 8+.


Note

Medium Risk
Upgrading the core HTTP client dependency can introduce behavioral/compatibility changes at runtime even though the diff is a single version bump.

Overview
Updates the OkHttp dependency version in build.gradle.kts from 4.12.0 to 5.3.2, so consumers of this library will build and run against OkHttp v5.

Written by Cursor Bugbot for commit 03de884. This will update automatically on new commits. Configure here.

v5.3.2 is the latest version of okhttp

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Comment thread build.gradle.kts
object Versions {
const val launchdarklyLogging = "1.1.1"
const val okhttp = "4.12.0"
const val okhttp = "5.3.2"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Kotlin plugin version not updated to match OkHttp 5

High Severity

Bumping OkHttp to 5.3.2 without updating the Kotlin plugin version from 1.6.10 (line 21) creates a major version mismatch. OkHttp 5.3.2 depends on kotlin-stdlib 2.2.21 and requires Kotlin 2.2.0+ to read its metadata. The build file's own comment (lines 32–34) explicitly warns that the Kotlin plugin version must match OkHttp's Kotlin version to avoid extra Kotlin runtime dependencies in the published pom. This mismatch may cause build failures or incorrect transitive dependencies for consumers of this library.

Fix in Cursor Fix in Web

@tanderson-ld

Copy link
Copy Markdown
Contributor

Hi, thank you for submitting this PR. What is the main driver for updating to v5?

We may have to consider how this will roll out with many other dependencies customers may be using.

@sebastto

Copy link
Copy Markdown

@tanderson-ld We’d appreciate it if you could take a look at this. Our team uses OkHttp as a direct dependency, and it’s also pulled in transitively through this package, which is causing compatibility issues.

tanderson-ld added a commit that referenced this pull request Nov 3, 2026
## 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.

<!-- CURSOR_SUMMARY -->
---

> [!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.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
afc39fd. 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: Marcin Dąbrowski <marcin.krzysztof.dabrowski@gmail.com>
@tanderson-ld

tanderson-ld commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Thank you again for motivating this, we bumped to 5.5.1 in #117 and tagged version 6.0.0 to incorporate it. Working on releasing now.

Closing as this should be addressed after it releases. Please re-open or log another issue if you run into any issues.

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.

3 participants