Restore missing OkHttp3 Additions in okhttp-android and okhttp-jvm#1434
Open
Copilot wants to merge 3 commits into
Open
Restore missing OkHttp3 Additions in okhttp-android and okhttp-jvm#1434Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing additions in OkHttp3 after update to Android and JVM
Restore missing OkHttp3 Additions in okhttp-android and okhttp-jvm
Jun 3, 2026
There was a problem hiding this comment.
Pull request overview
This PR restores previously shipped OkHttp3 “Additions” (hand-written helper APIs) that were lost when the okhttp binding split into okhttp-android (Square.OkHttp3.Android) and okhttp-jvm (Square.OkHttp3.JVM) for 5.x, and adds a type-forward in the okhttp shim to preserve source/binary compatibility for the newly reintroduced CallExtensions type.
Changes:
- Reintroduces helper APIs into both
okhttp-androidandokhttp-jvm(async helpers, delegate-based builder overloads, dispatcher helper, call extensions). - Adds
TypeForwardedToforSquare.OkHttp3.CallExtensionsin theokhttpshim assembly. - Updates
PublicAPI.Unshipped.txtfor both bindings to include the restored public surface area.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| source/com.squareup.okhttp3/okhttp/Additions/TypeForwards.cs | Adds a type-forward for the newly restored Square.OkHttp3.CallExtensions type for backward compatibility. |
| source/com.squareup.okhttp3/okhttp-android/Additions/Call.cs | Restores CallExtensions helpers (ExecuteAsync, delegate-based Enqueue). |
| source/com.squareup.okhttp3/okhttp-android/Additions/Dispatcher.cs | Adds Dispatcher.SetIdleCallback(IRunnable) helper. |
| source/com.squareup.okhttp3/okhttp-android/Additions/OkHttpClient.Builder.cs | Adds Func-based overloads for interceptors/authenticators/DNS/hostname verification via adapter implementations. |
| source/com.squareup.okhttp3/okhttp-android/Additions/ResponseBody.cs | Adds async convenience methods for ResponseBody (BytesAsync, StringAsync). |
| source/com.squareup.okhttp3/okhttp-android/PublicAPI/PublicAPI.Unshipped.txt | Declares the new public members/types for the Android binding in the API baseline. |
| source/com.squareup.okhttp3/okhttp-jvm/Additions/Call.cs | Restores CallExtensions helpers (ExecuteAsync, delegate-based Enqueue). |
| source/com.squareup.okhttp3/okhttp-jvm/Additions/Dispatcher.cs | Adds Dispatcher.SetIdleCallback(IRunnable) helper. |
| source/com.squareup.okhttp3/okhttp-jvm/Additions/OkHttpClient.Builder.cs | Adds Func-based overloads for interceptors/authenticators/DNS/hostname verification via adapter implementations. |
| source/com.squareup.okhttp3/okhttp-jvm/Additions/ResponseBody.cs | Adds async convenience methods for ResponseBody (BytesAsync, StringAsync). |
| source/com.squareup.okhttp3/okhttp-jvm/PublicAPI/PublicAPI.Unshipped.txt | Declares the new public members/types for the JVM binding in the API baseline. |
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.
The OkHttp3 Additions (hand-written helper/extension APIs) were dropped when the
okhttpbinding was split intookhttp-android(Square.OkHttp3.Android) andokhttp-jvm(Square.OkHttp3.JVM) for 5.x. Consumers lost APIs such asICall.ExecuteAsync():Changes
.csprojalready globsAdditions/*.cs):Call.cs—CallExtensions.ExecuteAsync(this ICall)andEnqueue(this ICall, Action<ICall,Response>, Action<ICall,IOException>)+ internalICallbackadapterDispatcher.cs—Dispatcher.SetIdleCallback(IRunnable)OkHttpClient.Builder.cs—Func-based overloads forAddInterceptor,AddNetworkInterceptor,Authenticator,ProxyAuthenticator,Dns,HostnameVerifier+ delegate adaptersResponseBody.cs—BytesAsync(),StringAsync()TypeForwardedTofor the newSquare.OkHttp3.CallExtensionstype in theokhttpshim. Other additions are members of already-forwarded types and need no entry.PublicAPI.Unshipped.txtfor both projects, in generator-matching sorted positions.Notes
okhttp-androidandokhttp-jvmso.Androidand.JVMconsumers reach parity with the pre-splitokhttppackage.IAuthenticator.Authenticatenow has a nullableRoute?parameter in 5.x; the restoredFunc<Route, Response, Request>signature is preserved as previously shipped, yielding a benign (non-fatal) nullability warning rather than a behavior/API change.