fix(uts/objects): align REST fixture provisioning with V2 objects API#497
Open
sacOO7 wants to merge 5 commits into
Open
fix(uts/objects): align REST fixture provisioning with V2 objects API#497sacOO7 wants to merge 5 commits into
sacOO7 wants to merge 5 commits into
Conversation
The `provision_objects_via_rest` helper described the legacy pre-V2 REST shape
(`POST .../objects` with a `{ "messages": [ { operation: { action, ... } } ] }`
envelope), which no longer matches the LiveObjects objects REST API.
Update it to the V2 contract (per the LiveObjects OpenAPI specification):
- endpoint is singular `POST .../object`;
- the body is a single operation object, or a bare JSON array (batch) — no
`messages` envelope;
- an operation is identified by its payload key (`mapSet`/`mapRemove`/`mapCreate`/
`counterInc`/`counterCreate`) with an `objectId` or `path` target (and optional
idempotency `id`); values are `{string|number|boolean|bytes|objectId}`;
- `mapCreate.semantics` is the integer 0 (LWW) with `{data:}`-wrapped entries.
Also update the only call site (RTPO15 in objects_lifecycle_test.md) to the V2
operation shape so the spec stays internally consistent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The REST fixture-provisioning helper still POSTed to https://sandbox-rest.ably.io, the legacy prod-sandbox host. Every other objects integration spec — and the whole UTS integration corpus (realtime + rest) — provisions apps and routes clients via https://sandbox.realtime.ably-nonprod.net (raw HTTP) / endpoint: "nonprod:sandbox" (SDK clients). The objects integration specs were migrated to the nonprod host in e57d340, but standard_test_pool.md was missed, leaving provision_objects_via_rest posting fixtures to a different backend than the app/key were provisioned on — so RTPO15 (rest-provisioned-data-sync) could never resolve. Point the helper at the canonical nonprod host to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Realtime client option blocks in objects_lifecycle_test.md (10) and objects_sync_test.md (5) set no host, so the SDK falls back to the production endpoint (realtime.ably.io, REC1a) — meaning the clients never reach the nonprod sandbox the "Sandbox Setup" provisions the app on. Every other UTS integration spec (realtime + rest) configures clients with endpoint: "nonprod:sandbox"; add it here to match so the tests actually exercise the sandbox. Added missing auto-connect false to clientOptions
c3435fd to
356b57f
Compare
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.
Summary
The
provision_objects_via_restREST fixture helper inuts/objects/helpers/standard_test_pool.mddescribed the legacy / pre-V2 objects REST shape and posted to the legacy prod-sandbox host. This
aligns it (and its only call site) with the V2 contract (per the LiveObjects OpenAPI specification,
ably-docs/static/open-specs/liveobjects.yaml, "Update LiveObjects REST API docs for V2 format",2026-01-22) and with the canonical nonprod sandbox host every other UTS integration spec uses.
What changed
1. V2 request shape
uts/objects/helpers/standard_test_pool.md— theprovision_objects_via_resthelper:POST …/channels/{ch}/objects(plural)POST …/channels/{ch}/object(singular){ "messages": [ … ] }operation: { action: "MAP_SET", objectId, mapSet:{…} }mapSet:{…}+ siblingobjectId/pathobjectIdonlyobjectIdorpathid;string/bytesmay carryencodingIt now documents each operation shape (
mapSet,mapRemove,mapCreate,counterInc,counterCreate),the
{ string | number | boolean | bytes | objectId }primitive values, andmapCreate.semanticsas theinteger
0(LWW) with{ data: … }-wrapped entries.uts/objects/integration/objects_lifecycle_test.md— the only caller (RTPO15,rest-provisioned-data-sync-0) updated to the V2 operation shape, so the spec stays internally consistent:2. Sandbox host
uts/objects/helpers/standard_test_pool.md— theprovision_objects_via_restPOSTURL:sandbox-rest.ably.iowas a stale leftover: the objects integration specs were migrated to the nonprodhost in
e57d340e, but the pooled helper was missed — leaving it provisioning fixtures on a differentbackend than the app/key are created on, so
RTPO15could never resolve.sandbox.realtime.ably-nonprod.netis the host the entire UTS integration corpus uses — raw HTTP (app provisioning) uses the explicit URL, and
SDK clients use
endpoint: "nonprod:sandbox", which resolves to the same host.sandbox-rest.ably.ionowappears nowhere in the objects module.
Validation
Every element was checked field-by-field against the V2 OpenAPI: singular
/objectpath,OperationRequest= single-or-array (no
messages),mapSet={key, value: PrimitiveValue},mapCreate.semanticsinteger0,objectId/pathtargets, idempotencyid, and thePrimitiveValueset (incl. optionalencoding).The host was cross-checked against every
realtime/integrationandrest/integrationspec: 82 raw-HTTPreferences to
https://sandbox.realtime.ably-nonprod.netand 196endpoint: "nonprod:sandbox"clientconfigs;
sandbox-rest.ably.iois used by no other spec file.Context
Surfaced while deriving the ably-java integration helper
(
uts/.../integration/standard/liveobjects/helpers.ktin ably-java), which is built to this same V2 shapeand the same nonprod host (via
restHost = ProxyManager.sandboxRealtimeHost).3. Sandbox host on the integration clients
uts/objects/integration/objects_lifecycle_test.md(10 client blocks) andobjects_sync_test.md(5) setno host on their
Realtime(...)options:Without an endpoint the SDK falls back to the production host (
realtime.ably.io, REC1a), so the clientswould never reach the nonprod sandbox the "Sandbox Setup" provisions the app on — the header was
aspirational. Every other UTS integration spec configures clients with
endpoint: "nonprod:sandbox"; thisadds it to match. (The proxy spec
objects_faults.mdalready routes correctly —nonprod:sandboxtarget +localhostproxy hop.)