From 2323add5a36f88f29d1eaa6c8f61ce6ecdb3300c Mon Sep 17 00:00:00 2001 From: Simon Woolf Date: Mon, 13 Apr 2026 11:37:57 +0100 Subject: [PATCH 1/2] Rewind param: stop making the non-ably-sdk fallback method the first thing we tell people about It doesn't make sense to start out by saying "rewind can _also_ be set by..." and then giving the MQTT/SSE fallback method when we haven't told people the actual, real method yet. Nor to have that as a top-level paragraph followed by an inset note explaining when you should use that method, it's absolutely not intuitive that the inset note is meant to qualify the previous not-inset paragraph --- src/pages/docs/channels/options/rewind.mdx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/pages/docs/channels/options/rewind.mdx b/src/pages/docs/channels/options/rewind.mdx index 32965f8537..2e8180429f 100644 --- a/src/pages/docs/channels/options/rewind.mdx +++ b/src/pages/docs/channels/options/rewind.mdx @@ -15,15 +15,7 @@ Rewind only has an effect on an initial channel attachment. Any subsequent reatt ## Subscribe with rewind -The `rewind` property of `params` can be set at a point in time in the past, or for a given number of messages. - -`rewind` can also be set by qualifying a channel name during a call to [`get()`](/docs/api/realtime-sdk/channels#get). For example, if you want to subscribe to channel `my_channel` and fetch the most recent message, you would specify the channel as `[?rewind=1]my_channel`. If the channel also contains metadata, you would apply rewind with `[some_metadata?rewind=1]my_channel`. - - - -A `rewind` value that is a number, `N`, is a request to attach to the channel at a position `N` messages before the present position. A `rewind` value with a time specifier is a request to attach to the channel at a point in time in the past, such as `10s` for 10 seconds, or `5m` for 5 minutes. +The `rewind` property of `params` can be set at a point in time in the past, or for a given number of messages. A `rewind` value that is a number, `N`, is a request to attach to the channel at a position `N` messages before the present position. A `rewind` value with a time specifier is a request to attach to the channel at a point in time in the past, such as `10s` for 10 seconds, or `5m` for 5 minutes. If the attachment is successful, and one or more messages exist on the channel prior to the present position, then those messages will be delivered to the subscriber immediately after the attachment has completed, and before any subsequent messages that arise in real time. @@ -135,6 +127,10 @@ channel.subscribe().listen((message) { ``` + + ### Retrieve a number of messages Set `rewind` to an integer to retrieve a given number of messages in the past. If fewer than the requested number of messages exists on the channel, including the case where there are no prior messages, then any available messages are sent. This does not constitute an error. From 07797af7a063eb5b95233c764881691515e72f1a Mon Sep 17 00:00:00 2001 From: Simon Woolf Date: Mon, 13 Apr 2026 11:41:25 +0100 Subject: [PATCH 2/2] Rewind: stop calling a param an option, not the same thing channel options: https://ably.com/docs/api/realtime-sdk/types#channel-options channel params: possible values for the channelOptions.params map --- src/pages/docs/channels/options/index.mdx | 10 +++++----- src/pages/docs/channels/options/rewind.mdx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/docs/channels/options/index.mdx b/src/pages/docs/channels/options/index.mdx index 4b491b1260..6f81a4af83 100644 --- a/src/pages/docs/channels/options/index.mdx +++ b/src/pages/docs/channels/options/index.mdx @@ -571,15 +571,15 @@ await channel.setOptions(channelOptions); The `cipher` property can be used to enable message [encryption](/docs/channels/options/encryption). This ensures that message payloads are opaque and can only only be decrypted by other clients that share your secret key. -## Channel options without Ably SDK support +## Channel params without Ably SDK support -For any Ably SDKs that do not currently expose the channel options API, a set of channel options can be expressed by including a query string with standard URL query syntax and encoding, within the qualifier part of a channel name. The qualifier part is in square brackets at the start of the channel name. +For any Ably SDKs that do not currently expose the channel options API, a set of channel params can be expressed by including a query string with standard URL query syntax and encoding, within the qualifier part of a channel name. The qualifier part is in square brackets at the start of the channel name. -To specify the channel option `foo` with value `bar` on channel `baz`, the qualified channel name would be `[?foo=bar]baz`. If the channel name already has a qualifier, such as `[meta]log`, then the query string follows the existing qualifier, as in `[meta?foo=bar]log`. +To specify the channel param `foo` with value `bar` on channel `baz`, the qualified channel name would be `[?foo=bar]baz`. If the channel name already has a qualifier, such as `[meta]log`, then the query string follows the existing qualifier, as in `[meta?foo=bar]log`. -Using this syntax with a non-supported Ably SDK means that channel options are specified for the lifetime of the `Channel` instance. In order to reference the same channel, but with different options, it is necessary to get a new `Channel` instance, using a qualified name that includes the new channel options. +Using this syntax with a non-supported Ably SDK means that channel params are specified for the lifetime of the `Channel` instance. In order to reference the same channel, but with different params, it is necessary to get a new `Channel` instance, using a qualified name that includes the new channel params. -For example, to specify the `rewind` channel option with the value `"1"`: +For example, to specify the `rewind` channel param with the value `"1"`: ```realtime_javascript diff --git a/src/pages/docs/channels/options/rewind.mdx b/src/pages/docs/channels/options/rewind.mdx index 2e8180429f..5fc1d50571 100644 --- a/src/pages/docs/channels/options/rewind.mdx +++ b/src/pages/docs/channels/options/rewind.mdx @@ -1,11 +1,11 @@ --- title: Rewind -meta_description: "The rewind channel option enables clients to attach to a channel and receive messages previously published on it." +meta_description: "The rewind channel param enables clients to attach to a channel and receive messages previously published on it." redirect_from: - /docs/realtime/channels/channel-parameters/rewind --- -The `rewind` channel option enables a client to specify where to start an attachment from, when attaching to a channel. Rewind can provide context to clients attaching to a channel by passing them previously published messages, such as in the example of a joining a chat room. +The `rewind` channel param enables a client to specify where to start an attachment from, when attaching to a channel. Rewind can provide context to clients attaching to a channel by passing them previously published messages, such as in the example of a joining a chat room. Clients can rewind to a point in time in the past, or for a given number of messages.