Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/data/versions.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
specification: "6.3.0"
specification: "6.4.0"
protocol: 6
27 changes: 18 additions & 9 deletions specifications/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,19 @@ Support for the deprecated client options `environment`, `restHost`, `realtimeHo
- `(RSL15c)` The SDK must not mutate the user-supplied `Message` object.
- `(RSL15d)` The request body must be encoded to the appropriate format per `RSC8`.
- `(RSL15e)` On success, returns an `UpdateDeleteResult` object. The API response body will contain a superset of the fields of a `UpdateDeleteResult`. Indicates an error if the operation was not successful.
- `(RSL16)` `RestChannel#object` attribute:
- `(RSL16a)` Returns the `RestObject` object for this channel [RSO1](../objects-features#RSO1)
- `(RSL16b)` It is a programmer error to access this property without first providing the `Objects` plugin ([PC5](#PC5)) in the client options. This programmer error should be handled in an idiomatic fashion; if this means accessing the property should throw an error, then the error should be an `ErrorInfo` with `statusCode` 400 and `code` 40019.

### Plugins

- `(PC1)` Specific client library features that are not commonly used may be supplied as independent libraries, as plugins, in order to avoid excessively bloating the client library. Although such plugins are packaged as independent libraries, they are still considered logically to be part of the client library code and, as such, may be tightly coupled with the client library implementation. The client library can be assumed to be aware of the plugin specific type and capabilities, and such plugins may by design be coupled to a specific version of the client library.
- `(PC2)` No generic plugin interface is specified, and therefore there is no common API exposed by all plugins. However, for type-safety, the opaque interface `Plugin` should be used in strongly-typed languages as the type of the `ClientOptions.plugins` collection as per [TO3o](#TO3o).
- `(PC3)` A plugin provided with the `PluginType` enum key value of `vcdiff` should be capable of decoding "vcdiff"-encoded messages. It must implement the `VCDiffDecoder` interface and the client library must be able to use it by casting it to this interface.
- `(PC3a)` The base argument of the `VCDiffDecoder.decode` method should receive the stored base payload of the last message on a channel as specified by [RTL19](#RTL19). If the base payload is a string it should be encoded to binary using UTF-8 before being passed as base argument of the `VCDiffDecoder.decode` method.
- `(PC5)` A plugin provided with the `PluginType` enum key value of `LiveObjects` should provide the [RealtimeObject](../objects-features#RTO23) feature functionality for realtime channels ([RTL27](#RTL27)). The plugin object itself is not expected to provide a public API. The type of the plugin object, and how it enables the Objects feature for a realtime channel, are left for individual implementations to decide.
- `(PC5)` A plugin provided with the `PluginType` enum key value of `LiveObjects` should provide the capabilities described in the subclauses below. The plugin object itself is not expected to provide a public API. The type of the plugin object, and how it enables these features for a channel, are left for individual implementations to decide.
- `(PC5a)` the [RealtimeObject](../objects-features#RTO23) feature functionality for realtime channels ([RTL27](#RTL27))
- `(PC5b)` the [RestObject](../objects-features#RSO1) feature functionality for REST channels ([RSL16](#RSL16))
- `(PC4)` A client library is allowed to accept plugins other than those specified in this specification, through the use of additional `ClientOptions.plugins` keys defined by that library. The library is responsible for defining the interface of these plugins, and for making sure that these keys do not clash with the keys defined in this specification.

### PluginType {#plugin-type}
Expand Down Expand Up @@ -444,6 +449,10 @@ Support for the deprecated client options `environment`, `restHost`, `realtimeHo
- `(RSAN3b)` Sends a GET request to the endpoint `/channels/{channelName}/messages/{messageSerial}/annotations`, where `messageSerial` is the identifier specified in the first argument, and any `params` are sent in the querystring
- `(RSAN3c)` Returns a `PaginatedResult<Annotation>` page containing the first page of decoded `Annotation` objects in the `PaginatedResult#items` attribute

### RestObject {#rest-object}

Reserved for `RestObject` feature specification, see [objects-features](../objects-features). Reserved spec point: `RSO`

### Forwards compatibility {#rest-compatibility}

- `(RSF1)` The library must apply the [robustness principle](https://en.wikipedia.org/wiki/Robustness_principle) in its processing of requests and responses with the Ably system. In particular, deserialization of Messages and related types, and associated enums, must be tolerant to unrecognised attributes or enum values. Such unrecognised values must be ignored.
Expand Down Expand Up @@ -1536,12 +1545,12 @@ 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
- `(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
Expand All @@ -1552,27 +1561,27 @@ 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
- `(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

Expand Down Expand Up @@ -2276,6 +2285,7 @@ Each type, method, and attribute is labelled with the name of one or more clause
class RestChannel: // RSL*
name: String // RSL9
presence: RestPresence // RSL3
object: RestObject // RSL16
history(
start: Time, // RSL2b1
end: Time api-default now(), // RSL2b1
Expand Down Expand Up @@ -2654,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
Expand Down
Loading
Loading