From 16e300e55ff0c7f3d58d3ceb4d6c2010bb95be70 Mon Sep 17 00:00:00 2001 From: Simon Woolf Date: Thu, 9 Jul 2026 22:39:32 +0100 Subject: [PATCH] only update attachSerial for non-resumed attaches --- build/data/versions.yaml | 2 +- specifications/api-docstrings.md | 2 +- specifications/features.md | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build/data/versions.yaml b/build/data/versions.yaml index 5c43e9640..882ef90f5 100644 --- a/build/data/versions.yaml +++ b/build/data/versions.yaml @@ -1,2 +1,2 @@ -specification: "6.0.0" +specification: "6.0.1" protocol: 6 diff --git a/specifications/api-docstrings.md b/specifications/api-docstrings.md index f0d9594b1..ef47eaa49 100644 --- a/specifications/api-docstrings.md +++ b/specifications/api-docstrings.md @@ -447,7 +447,7 @@ Describes the properties of the channel state. | Method / Property | Parameter | Returns | Spec | Description | |---|---|---|---|---| -| attachSerial: String? ||| CP2a | Starts unset when a channel is instantiated, then updated with the `channelSerial` from each [`ATTACHED`]{@link ChannelState#ATTACHED} event that matches the channel. Used as the value for [`untilAttach`]{@link RealtimeChannel#history}. | +| attachSerial: String? ||| CP2a | Starts unset when a channel is instantiated, then set to the `channelSerial` marking the point at which the channel's current period of message continuity began. Used as the value for [`untilAttach`]{@link RealtimeChannel#history}. | ## class PushChannel diff --git a/specifications/features.md b/specifications/features.md index 2928b0d91..86ee09e32 100644 --- a/specifications/features.md +++ b/specifications/features.md @@ -773,12 +773,13 @@ The threading and/or asynchronous model for each realtime library will vary by l - `(RTL27b)` It is a programmer error to access this property without first providing the `LiveObjects` 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. - `(RTL10)` `RealtimeChannel#history` function: - `(RTL10a)` Supports all the same params as `RestChannel#history` - - `(RTL10b)` Additionally supports the param `untilAttach`, which if true, will only retrieve messages prior to the moment that the channel was attached or emitted an `UPDATE` indicating loss of continuity. This bound is specified by passing the querystring param `fromSerial` with the `RealtimeChannel#properties.attachSerial` assigned to the channel in the `ATTACHED` `ProtocolMessage` (see [RTL15a](#RTL15a)). If the `untilAttach` param is specified when the channel is not attached, it results in an error + - `(RTL10b)` Additionally supports the param `untilAttach`, which if true, will only retrieve messages prior to the moment that the channel was attached or emitted an `UPDATE` indicating loss of continuity. This bound is specified by passing the querystring param `fromSerial` with the `RealtimeChannel#properties.attachSerial` (see [RTL15c](#RTL15c)). If the `untilAttach` param is specified when the channel is not attached, it results in an error - `(RTL10c)` Returns a `PaginatedResult` page containing the first page of messages in the `PaginatedResult#items` attribute returned from the history request - `(RTL10d)` A test should exist that publishes messages from one client, and upon confirmation of message delivery, a history request should be made on another client to ensure all messages are available - `(RTL12)` An attached channel may receive an additional `ATTACHED` `ProtocolMessage` from Ably at any point. (This is typically triggered following a transport being resumed to indicate a partial loss of message continuity on that channel, in which case the `ProtocolMessage` will have a `resumed` flag set to false). If and only if the `resumed` flag is false, this should result in the channel emitting an `UPDATE` event with a `ChannelStateChange` object. The `ChannelStateChange` object should have both `previous` and `current` attributes set to `attached`, the `reason` attribute set to to the `error` member of the `ATTACHED` `ProtocolMessage` (if any), and the `resumed` attribute set per the `RESUMED` bitflag of the `ATTACHED` `ProtocolMessage`. (Note that `UPDATE` should be the only event emitted: in particular, the library must not emit an `ATTACHED` event if the channel was already attached, see `RTL2g`). - `(RTL15)` `RealtimeChannel#properties` attribute is a `ChannelProperties` object representing properties of the channel state. `properties` is a publicly accessible member of the channel, but it is an experimental and unstable API. It has the following attributes: - - `(RTL15a)` `attachSerial` is unset when the channel is instantiated, and is updated with the `channelSerial` from each `ATTACHED` `ProtocolMessage` received from Ably with a matching `channel` attribute. The `attachSerial` value is used for `untilAttach` queries, see [RTL10b](#RTL10b) + - `(RTL15a)` This clause has been replaced by [`RTL15c`](#RTL15c) as of specification version 6.0.1. + - `(RTL15c)` `attachSerial` is unset when the channel is instantiated, and is updated with the `channelSerial` from each `ATTACHED` `ProtocolMessage` received from Ably with a matching `channel` attribute whose [RTL2f](#RTL2f) `resumed` attribute is `false`. The `attachSerial` value is used for `untilAttach` queries, see [RTL10b](#RTL10b) - `(RTL15b)` `channelSerial` is updated whenever a `ProtocolMessage` with either `MESSAGE`, `PRESENCE`, `ANNOTATION`, `OBJECT`, or `ATTACHED` actions is received on a channel, and is set to the `TR4c` `channelSerial` of that `ProtocolMessage`, if and only if that field (`ProtocolMessage.channelSerial`) is populated. - `(RTL15b1)` If the channel enters the `DETACHED`, `SUSPENDED`, or `FAILED` state, it must clear its `channelSerial`. - `(RTL13)` If the channel receives a server initiated `DETACHED` message when it is in the `ATTACHING`, `ATTACHED` or `SUSPENDED` state (i.e. the client has not explicitly requested a detach putting the channel into the `DETACHING` state), then the following applies: @@ -1749,7 +1750,7 @@ The core SDK provides an API for wrapper SDKs to supply Ably with analytics info h4. ChannelProperties - `(CP1)` properties of a channel and its state - `(CP2)` The attributes of `ChannelProperties` consist of: - - `(CP2a)` `attachSerial` string - contains the `channelSerial` that the current attachment started at, set per [RTL15a](#RTL15a) + - `(CP2a)` `attachSerial` string - contains the `channelSerial` that the current attachment started at, set per [RTL15c](#RTL15c) - `(CP2b)` `channelSerial` string - contains the last `channelSerial` received on the channel, set per [RTL15b](#RTL15b) #### ChannelDetails