Skip to content

Add a Kotlin client for Android and the JVM - #78

Merged
windischb merged 1 commit into
developfrom
claude/kotlin-client
Sep 10, 2026
Merged

windischb merged 1 commit into
developfrom
claude/kotlin-client

Conversation

@windischb

Copy link
Copy Markdown
Collaborator

Summary

  • New Kotlin client in src/Cocoar.SignalARRR.Kotlin/ — dev.cocoar:signalarrr (runtime) and dev.cocoar:signalarrr-ksp (typed proxies). Own transport like the Swift client: negotiate, WebSockets/SSE/Long Polling with fallback, JSON + MessagePack, keep-alive, server timeout, auto-reconnect. Coroutines + Flow; HARRRException with error codes; onServerMethod/registerInterface/stream handlers; HTTP stream references both ways; server cancellation as structured coroutine cancellation.
  • KSP processor: @HubProxy(name, pascalCase, kind = INTERFACE | SERVER_METHODS | HUB), @HubMethod, @GenericArguments.
  • Docs: new Kotlin Client section (setup, typed proxies), Kotlin column in client comparison and feature status, packages, getting started, README, changelog; skill regenerated.
  • CI: test-kotlin job (unit tests + KSP) on PR and develop; Java/Gradle added to the cross-platform integration job; scripts/run-integration-tests.sh kotlin.

Why not Microsoft's Java client

No automatic reconnect, no SSE / transport fallback, RxJava3 leaks into the API, open stream() memory leak, Android 7 regression in the MessagePack package. The parity table would have lost three rows.

Test plan

  • 102 unit tests (./gradlew :signalarrr:test) — protocols, MessagePack framing, error envelope, references, JsonValues, URLs, SignalRClient on MockWebServer
  • 66 integration tests against the IntegrationTestServer over WebSockets, SSE and Long Polling, JSON and MessagePack, incl. cancellation, upload/download, groups, error codes and the three KSP proxy kinds
  • CI green on this PR

Open

Maven Central publishing is not wired into CD yet — maven-publish is configured, publishToMavenLocal -Pversion=… works, but a Sonatype account and GPG signing secrets are needed for the release job. Docs reference 5.2.0 as the first published version.

🤖 Generated with Claude Code

The fifth client, built the way the Swift one is: a full SignalR client of
its own (negotiate, WebSockets, SSE and Long Polling with fallback, JSON and
MessagePack, keep-alive, server timeout, automatic reconnection) instead of
a wrapper around Microsoft's Java client, which has no reconnect, no SSE and
leaks RxJava into the API. Coroutines and Flow are the async model; the full
SignalARRR surface is covered: token challenges, structured errors with
codes, server-to-client handlers, stream handlers, HTTP stream references in
both directions, and cancellation as structured coroutine cancellation.

@hubproxy interfaces get a typed proxy from a KSP processor; ProxyKind
addresses contract interfaces, ServerMethods classes and hub methods, and
camelCase members map to PascalCase by default because the server lookup is
case-sensitive.

102 unit tests, 66 integration tests against the shared test server over all
three transports. Docs, README, changelog, skill, CI and the integration
script are updated; the Kotlin integration tests join the cross-platform job.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@windischb
windischb merged commit 3594b5d into develop Sep 10, 2026
13 checks passed
@windischb
windischb deleted the claude/kotlin-client branch September 10, 2026 16:48
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.

1 participant