You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ba47326
Browse filesBrowse the repository at this point in the historyBrowse files
Replace environment, restHost and realtimeHost with endpoint
2.0 adopts the REC1/REC2 host model (ADR-119): a single
ClientOptions.endpoint selects where both REST requests and the realtime
connection go, and the legacy environment, restHost and realtimeHost
options are removed outright, so old code fails to compile rather than
silently connecting to production.
- endpoint resolves as: unset -> main.realtime.ably.net; a routing policy
name -> [name].realtime.ably.net; nonprod:[name] ->
[name].realtime.ably-nonprod.net; a hostname (contains '.' or '::', or
is localhost) -> used as given. Default fallbacks follow the endpoint
([name].[a-e].fallback.ably-realtime[-nonprod].com) and a hostname has
none.
- Hosts now resolves from ClientOptions alone, so HttpCore and
ConnectionManager share one primary domain. The restHost/environment
conflict check, the rest.ably.io/realtime.ably.io defaults and the
<env>-[a-e]-fallback hosts go with the legacy options.
- An explicit fallbackHosts always replaces the defaults (REC2a2), and a
custom port or tlsPort no longer suppresses the default fallbacks, as
the spec has no such rule.
- The server and device builders swap restHost(), realtimeHost() and
environment() for endpoint().
The tests move to endpoint throughout: ABLY_ENV, ABLY_REST_HOST and
ABLY_REALTIME_HOST become ABLY_ENDPOINT (default nonprod:sandbox), UTS
and LiveObjects sandbox clients use the new
SandboxApp.sandboxEndpoint, and mock/proxy clients use a localhost
endpoint. Tests of the legacy host derivation and option conflicts are
replaced by DefaultsTest/HostsTest cases for each endpoint form, custom
fallbackHosts, and ports no longer disabling fallbacks. UPGRADING.md
gains the migration table and the firewall allowlist note.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/skills/uts-to-kotlin/SKILL.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -676,13 +676,12 @@ Recognise a **proxy** spec by a reference to `create_proxy_session()`, proxy `ru
676
676
677
677
A **direct-sandbox** spec (no `create_proxy_session`, no rules — just happy-path interop against `nonprod:sandbox`) uses the same `SandboxApp` provisioning and the same `runTest` / `@BeforeAll`+`runBlocking` lifecycle as a proxy test, but **drops all proxy wiring**: no `ProxyManager.ensureProxy()`, no `ProxySession`, no `connectThroughProxy`. The client connects straight to the sandbox host. `ChannelHistoryTest` (realtime) and `ObjectsLifecycleTest` (liveobjects) are the reference examples — read one before translating a direct-sandbox spec.
678
678
679
-
**Client wiring** — point both transports at the sandbox host (explicit hosts auto-disable fallback hosts, so no `fallbackHosts`):
679
+
**Client wiring** — point the client at the sandbox endpoint:
680
680
681
681
```kotlin
682
682
private fun newClient(useBinaryProtocol: Boolean): AblyRealtime = TestRealtimeClient {
@@ -728,7 +727,7 @@ Three helpers live under `uts/src/main/kotlin/io/ably/lib/uts/infra/integration/
728
727
729
728
- **`ProxyManager`** (`infra/integration/proxy/ProxyManager.kt`, package `io.ably.lib.uts.infra.integration.proxy`) — downloads/starts the shared `uts-proxy` process. Call `ProxyManager.ensureProxy()` once per suite in setup.
730
729
- **`ProxySession`** (`infra/integration/proxy/ProxySession.kt`, same package) — one programmable session wrapping the proxy control API; also defines the `connectThroughProxy` extension and the rule-builder helpers.
731
-
- **`SandboxApp`** (`infra/integration/SandboxApp.kt`, package `io.ably.lib.uts.infra.integration`) — provisions/deletes a sandbox test app from the shared `test-app-setup.json` in ably-common. `SandboxApp.create()` returns a `SandboxApp` with `appId`, `defaultKey`, and `keys` (`defaultKey` is a full-capability `appId.keyId:keySecret`); `app.delete()` tears it down. Provision in suite setup, delete in teardown. Also owns the single upstream sandbox host constant `SandboxApp.sandboxHost` (`sandbox.realtime.ably-nonprod.net`, the resolved `nonprod:sandbox` endpoint) — the default target of every `ProxySession` (both `realtimeHost` and `restHost`), and what direct-sandbox clients set `realtimeHost` / `restHost` from.
730
+
- **`SandboxApp`** (`infra/integration/SandboxApp.kt`, package `io.ably.lib.uts.infra.integration`) — provisions/deletes a sandbox test app from the shared `test-app-setup.json` in ably-common. `SandboxApp.create()` returns a `SandboxApp` with `appId`, `defaultKey`, and `keys` (`defaultKey` is a full-capability `appId.keyId:keySecret`); `app.delete()` tears it down. Provision in suite setup, delete in teardown. Also owns `SandboxApp.sandboxEndpoint` (`nonprod:sandbox`), which direct-sandbox clients set as their `endpoint`, and `SandboxApp.sandboxHost` (`sandbox.realtime.ably-nonprod.net`, the hostname that endpoint resolves to) — the default upstream target of every `ProxySession`.
732
731
733
732
Import what the tier needs: a **direct-sandbox** test imports `io.ably.lib.uts.infra.integration.SandboxApp` plus `io.ably.lib.uts.infra.unit.TestRealtimeClient` and `io.ably.lib.uts.infra.{awaitState, pollUntil}`; a **proxy** test additionally imports `io.ably.lib.uts.infra.integration.proxy.{ProxyManager, ProxySession, connectThroughProxy}`.
734
733
@@ -799,11 +798,11 @@ val client = TestRealtimeClient {
799
798
}
800
799
```
801
800
802
-
ably-java has **no `endpoint` ClientOptions field**; `connectThroughProxy` sets the discrete host fields for you:
801
+
`connectThroughProxy` sets the proxy-def options for you:
803
802
804
803
| Proxy-def option | What `connectThroughProxy` sets |
0 commit comments