[Split 2/3] Add io.ably.pubsub:device and :server door packages with side-declaring agents - #1233
Draft
umair-ably wants to merge 1 commit into
Draft
Conversation
Adds the two public artifacts of the PDR-091b split, following the ably-js reference implementation (ably-js#2293): - io.ably.pubsub:server (jar, on :core): PubSubServer.httpClientBuilder() and PubSubServer.realtimeClientBuilder(), each accepting everything the core constructors accept (ClientOptions, API key or token string). - io.ably.pubsub:device (aar, on :core-android): PubSubDevice.clientBuilder(), one door per PDR-091. - A shared side helper (shared/src/main/java, compiled into both door artifacts rather than published) owns the ably-pubsub-device and ably-pubsub-server agent identifiers and the stamping rules: caller entries preserved, side entry applied last and unoverridable, caller's options never mutated, null passing through to the core's own error. The -device/-server suffixes are load-bearing for MAU billing classification and documented as such. - Fixes ClientOptions.copy() to carry headers, fallbackHosts, transportParams and agents, which it previously dropped; the doors rely on copy() for non-mutating stamping. Covered by a new unit test. - Server tests include a wire-level assertion that the Ably-Agent HTTP header carries ably-pubsub-server/<version> alongside the ably-java base identifier; device instrumentation tests assert the same contract and run in the emulator matrix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Sep 1, 2026
umair-ably
added a commit
to ably/ably-common
that referenced
this pull request
Sep 1, 2026
PDR-091b splits every Pub/Sub SDK into per-side packages whose factories stamp a side-declaring agent entry so that MAU classification never has to guess which side a connection is on. The identifiers are shared across languages: ably/ably-js#2293, ably/ably-java#1233 and ably/ably-ruby#453 all stamp the same ably-pubsub-device / ably-pubsub-server strings, each with its own package version, alongside the SDK's own agent entry. Register both identifiers so the realtime system classifies them as known agents rather than by their -device/-server suffix alone. Names are language-neutral because the identifiers are. The schema requires a single source repository for wrapper-type agents, but these are the registry's first multi-repo identifiers; ably-js is given as the first publisher, with the caveat noted in the PR that fetch-agent-releases will attribute all stamped versions to ably-js releases until the schema can express multiple sources. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Second PR in the PDR-091b split stack (stacked on #1232; diff shows only this PR's changes). Reference: ably-js#2293, whose
packages/shared/side.tscontract this ports.What this PR does
io.ably.pubsub:server(jar → depends on:core):PubSubServer.httpClientBuilder(...)/PubSubServer.realtimeClientBuilder(...), per the door names agreed in PDR-091b2. Builders accept everything the core constructors accept (ClientOptions, API key string, token string — reusing the core's colon-rule disambiguation) and stamp the side atbuild().io.ably.pubsub:device(aar → depends on:core-android):PubSubDevice.clientBuilder(...)— one door, per PDR-091 (device-side connectionless ops stay available on the one client).shared/, compiled into both door artifacts, not published — the Java analogue of ably-js'spackages/shared/side.ts):ably-pubsub-device/ably-pubsub-server, with the load-bearing-suffix warning comment (the-serversuffix is what earns the MAU exemption on API-key auth);agentsentries preserved; the side entry is applied last and cannot be overridden; the caller'sClientOptionsis never mutated;nullpasses through to the core's own initialization error.ably-java/<version>base identifier — unchanged, already in the ably-common registry.ClientOptions.copy(), which silently droppedheaders,fallbackHosts,transportParamsandagents. The doors rely oncopy()for non-mutating stamping; the pre-existing internal callers ofcopy()also benefit. Unit-tested.Tests (what billing reads — they fail loudly)
server: unit tests for stamping/preservation/override/no-mutation/null, plus a wire-level test that spins a local HTTP server and asserts the actualAbly-Agentheader containsably-pubsub-server/2.0.0andably-java/. Runs incheck.ymlvia the existing unqualifiedrunUnitTestsinvocation.device: instrumentation tests asserting the same contract, added to theemulate.ymlmatrix (:device:connectedAndroidTest).Open items flagged for review
ably-pubsub-device/ably-pubsub-serverare not yet in the ably-common agents registry (checkedprotocol/agents.jsonon main, 2026-09-01) — needs an ably-common PR before any release; identifiers here match the ably-js branch exactly.io.ably.pubsub.internal.Sideclass — same pattern as the existinglib/source shared between the two cores; harmless if both artifacts ever meet on a classpath.🤖 Generated with Claude Code