From 460323a949db0f47abc5c8e541774f71c29fac35 Mon Sep 17 00:00:00 2001 From: evgeny Date: Wed, 4 Nov 2026 18:20:53 +0000 Subject: [PATCH 1/3] Carry JSON ObjectData values in the json field OD4c5, OD4d5, OD5a2 and OD5b3 described JSON leaf values as a `string` with `encoding: "json"`, which the service does not honour. JSON leaves are carried in the OD2g `json` field as a JSON-encoded string with both protocols, so encode and decode them there. Co-Authored-By: Claude Opus 5.5 --- specifications/features.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specifications/features.md b/specifications/features.md index 7aebbce66..4c2614030 100644 --- a/specifications/features.md +++ b/specifications/features.md @@ -1550,7 +1550,7 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info - `(OD2d)` `bytes` binary \| string - a primitive binary leaf value in the object graph. It is sent to and received from the server as a Base64-encoded string when using the JSON protocol - `(OD2e)` `number` number - a primitive number leaf value in the object graph - `(OD2f)` `string` string - a primitive string leaf value in the object graph - - `(OD2g)` `json` JsonObject \| JsonArray - a primitive JSON leaf value (an object or array) in the object graph. It is sent to and received from the server as a JSON-encoded string when using the JSON protocol + - `(OD2g)` `json` JsonObject \| JsonArray - a primitive JSON leaf value (an object or array) in the object graph. It is sent to and received from the server as a JSON-encoded string, with both the JSON and MessagePack protocols - `(OD3)` The size of the `ObjectData` is calculated as follows: - `(OD3a)` The size is the sum of the sizes of the `boolean`, `bytes`, `number`, `string`, and `json` properties - `(OD3b)` If set, the size of a `boolean` property is 1 @@ -1567,21 +1567,21 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info - `(OD4c2)` A binary payload is encoded as a MessagePack binary type, and the result is set on the `ObjectData.bytes` attribute - `(OD4c3)` A number payload is encoded as a MessagePack float64 type, and the result is set on the `ObjectData.number` attribute - `(OD4c4)` A string payload is encoded as a MessagePack string type, and the result is set on the `ObjectData.string` attribute - - `(OD4c5)` A payload consisting of a JSON-encodable object or array is stringified as a JSON object or array, encoded as a MessagePack string type, and the result is set on the `ObjectData.string` attribute. The `ObjectData.encoding` attribute is then set to "json" + - `(OD4c5)` A payload consisting of a JSON-encodable object or array is stringified as a JSON object or array, encoded as a MessagePack string type, and the result is set on the `ObjectData.json` attribute - `(OD4d)` When the JSON protocol is used: - `(OD4d1)` A boolean payload is represented as a JSON boolean and set on the `ObjectData.boolean` attribute - `(OD4d2)` A binary payload is Base64-encoded and represented as a JSON string; the result is set on the `ObjectData.bytes` attribute - `(OD4d3)` A number payload is represented as a JSON number and set on the `ObjectData.number` attribute - `(OD4d4)` A string payload is represented as a JSON string and set on the `ObjectData.string` attribute - - `(OD4d5)` A payload consisting of a JSON-encodable object or array is stringified as a JSON object or array, represented as a JSON string and the result is set on the `ObjectData.string` attribute. The `ObjectData.encoding` attribute is then set to "json" + - `(OD4d5)` A payload consisting of a JSON-encodable object or array is stringified as a JSON object or array, represented as a JSON string and the result is set on the `ObjectData.json` attribute - `(OD5)` `ObjectData` decoding: - `(OD5a)` When the MessagePack protocol is used: - `(OD5a1)` The payloads in `ObjectData.boolean`, `ObjectData.bytes`, `ObjectData.number`, and `ObjectData.string` are decoded as their corresponding MessagePack types - - `(OD5a2)` If `ObjectData.encoding` is set to "json", the `ObjectData.string` content is decoded by parsing the string as JSON + - `(OD5a2)` The `ObjectData.json` payload is decoded as a MessagePack string type, and the result is parsed as JSON - `(OD5b)` When the JSON protocol is used: - `(OD5b1)` The payloads in `ObjectData.boolean`, `ObjectData.number`, and `ObjectData.string` are decoded as their corresponding JSON types - `(OD5b2)` The `ObjectData.bytes` payload is Base64-decoded into a binary value - - `(OD5b3)` If `ObjectData.encoding` is set to "json", the `ObjectData.string` content is decoded by parsing the string as JSON + - `(OD5b3)` The `ObjectData.json` payload is decoded as a JSON string, and the result is parsed as JSON #### Annotation From fb9315c87bdcad23e28bd7ee746bf220b3ad0f54 Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 12 Nov 2026 16:50:11 +0000 Subject: [PATCH 2/3] Remove the ObjectData encoding field With JSON leaf values carried in the OD2g `json` field, nothing sets `ObjectData.encoding` any more, so delete OD2b and OD4b, drop the field from the IDL, and stop referring to it from RSO9c1. Co-Authored-By: Claude Opus 5.5 --- specifications/features.md | 5 ++--- specifications/objects-features.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/specifications/features.md b/specifications/features.md index 4c2614030..f842f9959 100644 --- a/specifications/features.md +++ b/specifications/features.md @@ -1545,7 +1545,7 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info - `(OD1)` An `ObjectData` represents a value in an object on a channel - `(OD2)` The attributes available in an `ObjectData` are listed below. Of the value fields - `boolean`, `bytes`, `number`, `string` and `json` - at most one must be set at a time: - `(OD2a)` `objectId` string - a reference to another object - - `(OD2b)` `encoding` string - may be set by the client library to indicate that value in `string` field have an encoding + - `(OD2b)` This clause has been deleted as of specification version 6.4.0. - `(OD2c)` `boolean` boolean - a primitive boolean leaf value in the object graph - `(OD2d)` `bytes` binary \| string - a primitive binary leaf value in the object graph. It is sent to and received from the server as a Base64-encoded string when using the JSON protocol - `(OD2e)` `number` number - a primitive number leaf value in the object graph @@ -1561,7 +1561,7 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info - `(OD3f)` The size of a `null` or omitted property is zero - `(OD4)` `ObjectData` encoding: - `(OD4a)` Payloads must be booleans, binary, numbers, strings, or JSON-encodable objects or arrays. Any other data type must not be permitted and result in an error with code 40013 - - `(OD4b)` `ObjectData.encoding` must be left unset unless specified otherwise by the payload encoding procedure in [OD4c](#OD4c) and [OD4d](#OD4d) + - `(OD4b)` This clause has been deleted as of specification version 6.4.0. - `(OD4c)` When the MessagePack protocol is used: - `(OD4c1)` A boolean payload is encoded as a MessagePack boolean type, and the result is set on the `ObjectData.boolean` attribute - `(OD4c2)` A binary payload is encoded as a MessagePack binary type, and the result is set on the `ObjectData.bytes` attribute @@ -2664,7 +2664,6 @@ Each type, method, and attribute is labelled with the name of one or more clause class ObjectData // OD*, internal objectId: String? // OD2a - encoding: String? // OD2b boolean: Boolean? // OD2c bytes: Binary? | String? // OD2d number: Number? // OD2e diff --git a/specifications/objects-features.md b/specifications/objects-features.md index d71a43f2c..a3de8d578 100644 --- a/specifications/objects-features.md +++ b/specifications/objects-features.md @@ -107,7 +107,7 @@ Objects feature enables clients to store shared data as "objects" on a channel. - `(RSO9a)` `RestLiveMap` ([RSO14](#RSO14)), returned when the response body has a `map` field per [RSO2g1](#RSO2g1) - `(RSO9b)` `RestLiveCounter` ([RSO15](#RSO15)), returned when the response body has a `counter` field per [RSO2g2](#RSO2g2) - `(RSO9c)` A decoded [`ObjectData`](../features#OD1) leaf, returned when the response is a typed leaf value per [RSO2g3](#RSO2g3). The library must return an `ObjectData` instance with: - - `(RSO9c1)` The [`objectId`](../features#OD2a) and [`encoding`](../features#OD2b) fields unset. (If the response carried an object reference, the result would instead be a `RestLiveMap` ([RSO9a](#RSO9a)), `RestLiveCounter` ([RSO9b](#RSO9b)), or unrecognized-object fallback ([RSO9d](#RSO9d)).) + - `(RSO9c1)` The [`objectId`](../features#OD2a) field unset. (If the response carried an object reference, the result would instead be a `RestLiveMap` ([RSO9a](#RSO9a)), `RestLiveCounter` ([RSO9b](#RSO9b)), or unrecognized-object fallback ([RSO9d](#RSO9d)).) - `(RSO9c2)` Values decoded per [OD5](../features#OD5): in particular, `bytes` holds a native `Binary` value rather than a Base64-encoded string, and any JSON-encoded payload appears as the parsed `JsonObject` or `JsonArray` rather than as a JSON-encoded string - `(RSO9d)` For object types unrecognized by the library, an object containing at minimum `{ objectId: String }`, with additional fields passed through unmodified per [RSF1](../features#RSF1) - `(RSO10)` `RestObjectPublishResult` is the return type of [`RestObject#publish`](#RSO3). Its attributes are: From 476a299d2dd5d38b871a6ab99ec14134116ae23f Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 12 Nov 2026 17:42:53 +0000 Subject: [PATCH 3/3] Bump specification version to 6.4.0 Co-Authored-By: Claude Opus 5.5 --- build/data/versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/data/versions.yaml b/build/data/versions.yaml index d6c64d8a3..b7a966301 100644 --- a/build/data/versions.yaml +++ b/build/data/versions.yaml @@ -1,2 +1,2 @@ -specification: "6.3.0" +specification: "6.4.0" protocol: 6