Skip to content

chore(deps): Bump OkHttp from 4.9.2 to 5.5.1 (JAVA-715) - #6472

Open
runningcode wants to merge 2 commits into
9.x.xfrom
no/java-715-bump-okhttp-to-5x
Open

runningcode wants to merge 2 commits into
9.x.xfrom
no/java-715-bump-okhttp-to-5x

Conversation

@runningcode

@runningcode runningcode commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Bump to okhttp 5.5.1 from 4.9.2.

This doesn't break anything and also fixes a bug, so we can merge this against the 8.x branch too. That might be best since it lessens the chance of merge conflicts of only having changes on the v9 branch.

sentry-okhttp and the Spring Boot integrations still haveokhttp as compileOnly, so we still use whatever version the apps bring. Okhttp 4 and 5 have the same API.

The only change is that this bump revealed a bug in SentryOkHttpEventListener. connectFailed() marked the whole call span INTERNAL_ERROR, even though OkHttp retries the next route and often succeeds. OkHttp 5 makes this more common: it tries IPv6 first and races routes (Happy Eyeballs).

We still keep the previous mockwebserver split where we have two different test versions but they are both now bumped.. This was probably what was preventing the version bumps before though.

💡 Motivation and Context

OkHttp 5 can combine several EventListeners (5.3.0+), which we want to build on. The earlier bump (#6464) failed in sentry-apollo and the Android UI tests for the reasons above.

💚 How did you test it?

Unit tests of every module that uses okhttp, the Spring Boot integrationTest suites, and the UI test APK builds with and without integrations. New tests in SentryOkHttpEventListenerTest cover a call that recovers from a failed route and a call that fails on every route.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🤖 Generated with Claude Code

sentry-okhttp and the Spring Boot integrations still compile against okhttp as compileOnly. The
okhttp3 members they reference are identical for 4.9.2 and 5.5.1, so OkHttp 4 keeps working at
runtime.

OkHttp 5 tries IPv6 first and races routes, which surfaced a bug: connectFailed() marked the
whole call span INTERNAL_ERROR even when OkHttp then connected on another route. It now only
closes the connect timing. callFailed() still reports a call that fails on every route.

sentry-apollo and the Android UI tests stay on mockwebserver 4. Apollo 2 passes a null body to
Response.Builder.body(), and the UI test APK is pinned to the app's okio 2, while OkHttp 5 needs
okio 3.

Fixes JAVA-715

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 5, 2026

Copy link
Copy Markdown

JAVA-715

@sentry

sentry Bot commented Nov 5, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.62.0 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode marked this pull request as ready for review November 5, 2026 13:40
@runningcode runningcode added the sanity-check PR needs a lightweight review for obvious issues label Nov 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant