diff --git a/src/components/Layout/mdx/Admonition.tsx b/src/components/Layout/mdx/Admonition.tsx index 7c16ea1110..5f93647ee8 100644 --- a/src/components/Layout/mdx/Admonition.tsx +++ b/src/components/Layout/mdx/Admonition.tsx @@ -3,7 +3,7 @@ import cn from '@ably/ui/core/utils/cn'; import Aside from 'src/components/blocks/dividers/Aside'; import { HtmlComponentPropsData } from 'src/components/html-component-props'; -const LEGACY_ADMONITION_TYPES = ['new', 'updated', 'experimental']; +const LEGACY_ADMONITION_TYPES = ['new', 'updated', 'experimental', 'public-preview']; type AdmonitionVariant = 'neutral' | 'note' | 'further-reading' | 'important' | 'warning'; diff --git a/src/components/blocks/dividers/Aside.tsx b/src/components/blocks/dividers/Aside.tsx index 8bacaeb0aa..edf5ce7ad2 100644 --- a/src/components/blocks/dividers/Aside.tsx +++ b/src/components/blocks/dividers/Aside.tsx @@ -19,6 +19,7 @@ const versioningColors: { [key: string]: { bg: string; text: string } } = { new: { bg: '#FFF0BA', text: '#AC8600' }, updated: { bg: '#FFB8F1', text: '#9C007E' }, experimental: { bg: '#D8BCFB', text: '#460894' }, + 'public-preview': { bg: '#B8E6FF', text: '#005A8C' }, }; const Aside = ({ data, attribs }: HtmlComponentProps<'div'>) => { diff --git a/src/pages/docs/api/realtime-sdk/channels.mdx b/src/pages/docs/api/realtime-sdk/channels.mdx index 2160157d91..2b22eac6a3 100644 --- a/src/pages/docs/api/realtime-sdk/channels.mdx +++ b/src/pages/docs/api/realtime-sdk/channels.mdx @@ -824,6 +824,8 @@ Failure to retrieve the message history will trigger the `errback` callbacks of Retrieves the latest version of a specific message by its serial identifier. Requires the **history** [capability](/docs/auth/capabilities). +See [updating and deleting messages: retrieving the latest version](/docs/messages/updates-deletes#get) for more information. + ##### Parameters | Parameter | Description | Type | @@ -836,11 +838,11 @@ Returns a promise which, upon success, will be fulfilled with a [`Message`](/doc #### updateMessage -`updateMessage(message: Message, operation?: MessageOperation, params?: Record): Promise` +`updateMessage(message: Message, operation?: MessageOperation): Promise` -Publishes an update to an existing message with patch semantics. Non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-update-own** or **message-update-any** [capability](/docs/auth/capabilities). +Publishes an update to an existing message with shallow mixin semantics. Non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-update-own** or **message-update-any** [capability](/docs/auth/capabilities). -See [updating and deleting messages](/docs/messages/updates-deletes) for more information. +See [updating and deleting messages: updates](/docs/messages/updates-deletes#update) for more information. ##### Parameters @@ -848,19 +850,18 @@ See [updating and deleting messages](/docs/messages/updates-deletes) for more in |-----------|-------------|------| | message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field and the fields to update | [`Message`](/docs/api/realtime-sdk/messages) | | operation | An optional `MessageOperation` object containing metadata about the update operation. Can include `clientId`, `description`, and `metadata` fields | `MessageOperation` (optional) | -| params | Optional parameters sent as part of the query string | `Record` (optional) | ##### Returns -Returns a promise which, upon success, will be fulfilled. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. +Returns a promise which, upon success, will be fulfilled with an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. #### deleteMessage -`deleteMessage(message: Message, operation?: MessageOperation, params?: Record): Promise` +`deleteMessage(message: Message, operation?: MessageOperation): Promise` -Marks a message as deleted by publishing an update with an action of `MESSAGE_DELETE`. This does not remove the message from the server, and the full message history remains accessible. Uses patch semantics: non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-delete-own** or **message-delete-any** [capability](/docs/auth/capabilities). +Marks a message as deleted by publishing an update with an action of `MESSAGE_DELETE`. This does not remove the message from the server, and the full message history remains accessible. Uses shallow mixin semantics: non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-delete-own** or **message-delete-any** [capability](/docs/auth/capabilities). -See [updating and deleting messages](/docs/messages/updates-deletes) for more information. +See [updating and deleting messages: deletes](/docs/messages/updates-deletes#delete) for more information. ##### Parameters @@ -868,11 +869,29 @@ See [updating and deleting messages](/docs/messages/updates-deletes) for more in |-----------|-------------|------| | message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field | [`Message`](/docs/api/realtime-sdk/messages) | | operation | An optional `MessageOperation` object containing metadata about the delete operation. Can include `clientId`, `description`, and `metadata` fields | `MessageOperation` (optional) | -| params | Optional parameters sent as part of the query string | `Record` (optional) | ##### Returns -Returns a promise which, upon success, will be fulfilled. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. +Returns a promise which, upon success, will be fulfilled with an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. + +#### appendMessage + +`appendMessage(message: Message, operation?: MessageOperation): Promise` + +Appends data to an existing message. The supplied `data` field is appended to the previous message's data, while all other fields (`name`, `extras`) replace the previous values if provided. Requires the **message-update-own** or **message-update-any** [capability](/docs/auth/capabilities). + +See [updating and deleting messages: appends](/docs/messages/updates-deletes#append) for more information. + +##### Parameters + +| Parameter | Description | Type | +|-----------|-------------|------| +| message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field and the data to append | [`Message`](/docs/api/realtime-sdk/messages) | +| operation | An optional `MessageOperation` object containing metadata about the append operation. Can include `clientId`, `description`, and `metadata` fields | `MessageOperation` (optional) | + +##### Returns + +Returns a promise which, upon success, will be fulfilled with an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. #### getMessageVersions @@ -880,7 +899,7 @@ Returns a promise which, upon success, will be fulfilled. Upon failure, the prom Retrieves all historical versions of a specific message, ordered by version. This includes the original message and all subsequent updates or delete operations. Requires the **history** [capability](/docs/auth/capabilities). -See [updating and deleting messages](/docs/messages/updates-deletes) for more information. +See [updating and deleting messages: message versions](/docs/messages/updates-deletes#versions) for more information. ##### Parameters diff --git a/src/pages/docs/api/realtime-sdk/types.mdx b/src/pages/docs/api/realtime-sdk/types.mdx index d588159d4e..384572f7ad 100644 --- a/src/pages/docs/api/realtime-sdk/types.mdx +++ b/src/pages/docs/api/realtime-sdk/types.mdx @@ -432,7 +432,7 @@ This will typically be empty as all messages received from Ably are automaticall The action type of the message, one of the [`MessageAction`](/docs/api/realtime-sdk/types#message-action) enum values. -_Type: `int enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, META, MESSAGE_SUMMARY }`_ +_Type: `int enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, META, MESSAGE_SUMMARY, MESSAGE_APPEND }`_ ### serial @@ -498,6 +498,7 @@ An `Array` of [`Message`](/docs/api/realtime-sdk/types#message) objects 'message.delete', 'meta', 'message.summary' + 'message.append', ] ``` @@ -513,6 +514,7 @@ An `Array` of [`Message`](/docs/api/realtime-sdk/types#message) objects 'message.delete', 'meta', 'message.summary' + 'message.append', ] ``` @@ -530,6 +532,7 @@ An `Array` of [`Message`](/docs/api/realtime-sdk/types#message) objects MESSAGE_DELETE, // 2 META, // 3 MESSAGE_SUMMARY // 4 + MESSAGE_APPEND, // 5 } ``` @@ -549,6 +552,7 @@ An `Array` of [`Message`](/docs/api/realtime-sdk/types#message) objects ARTMessageActionDelete, ARTMessageActionMeta, ARTMessageActionMessageSummary + ARTMessageActionAppend, }; ``` @@ -564,6 +568,7 @@ An `Array` of [`Message`](/docs/api/realtime-sdk/types#message) objects case Delete case Meta case Summary + case Append } ``` @@ -580,6 +585,26 @@ An `Array` of [`Message`](/docs/api/realtime-sdk/types#message) objects |----------|-------------|------| | summary | An object whose keys are annotation types, and the values are aggregated summaries for that annotation type | `Record` | +### PublishResult + +Contains the result of a publish operation. + +#### PropertiesMembersAttributes + +| Property | Description | Type | +|----------|-------------|------| +| serialsSerials | An array of message serials corresponding 1:1 to the messages that were published. A serial may be null if the message was discarded due to a configured conflation rule. | `String[]` | + +### UpdateDeleteResult + +Contains the result of an update, delete, or append message operation. + +#### PropertiesMembersAttributes + +| Property | Description | Type | +|----------|-------------|------| +| versionSerialVersionSerial | The serial of the version of the updated, deleted, or appended message. Will be null if the message was superseded by a subsequent update before it could be published. | `String` | + ### PresenceMessageio.ably.lib.types.PresenceMessageAbly::Models::PresenceMessageARTPresenceMessageIO.Ably.PresenceMessage A `PresenceMessage` represents an individual presence update that is sent to or received from Ably. diff --git a/src/pages/docs/api/rest-api.mdx b/src/pages/docs/api/rest-api.mdx index 455091a272..e5d1edcfc9 100644 --- a/src/pages/docs/api/rest-api.mdx +++ b/src/pages/docs/api/rest-api.mdx @@ -682,24 +682,27 @@ See [MessageAction](/docs/api/realtime-sdk/types#message-action) for the possibl An unsuccessful request returns an error. A 404 error is returned if a message with that serial does not exist. -### Update a message +### Update, delete, or append to a message #### PATCH main.realtime.ably.net/channels/\/messages/\ -Update an existing message on a channel, the message with the specified serial. This endpoint requires that the channel is configured with the "Message annotations, updates, and deletes" channel rule. +Update, delete, or append to an existing message on a channel, identified by its serial. This endpoint requires that the channel is configured with the "Message annotations, updates, and deletes" channel rule. -See [Updating and deleting messages](/docs/messages/updates-deletes#update) for more information about message updates and field semantics. +See [Updating and deleting messages](/docs/messages/updates-deletes) for more information about this feature. -The request body contains the message fields to update, along with optional operation metadata. Any fields not specified will be left as their original values. +The request body contains a Message object with an `action` field specifying the operation, the fields to update, and optional operation metadata in `version`. Any fields not specified will be left as their original values (shallow mixin semantics). For appends, the `data` field is concatenated to the existing message's data rather than replacing it. + +The `action` should be set to a [MessageAction](/docs/api/realtime-sdk/types#message-action) int enum: `MESSAGE_UPDATE` (1), `MESSAGE_DELETE` (2), or `MESSAGE_APPEND` (5). ```json { + action: , name: , data: , encoding: , extras: , - operation: { + version: { clientId: , description: , metadata: @@ -717,8 +720,9 @@ curl -X PATCH https://main.realtime.ably.net/channels/rest-example/messages/0182 -H "Content-Type: application/json" \ --data \ '{ + "action": 1, "data": "updated message content", - "operation": { + "version": { "description": "Fixed typo" } }' @@ -735,116 +739,19 @@ curl -X PATCH https://main.realtime.ably.net/channels/rest-example/messages/0182 ##### Capabilities -- `message-update-own` := Can update your own messages (messages where the original publisher's `clientId` matches the updater's `clientId`, where both are [identified](/docs/auth/identified-clients)) -- `message-update-any` := Can update any message on the channel +- `message-update-own` := Can update or append to your own messages (messages where the original publisher's `clientId` matches the updater's `clientId`, where both are [identified](/docs/auth/identified-clients)) +- `message-update-any` := Can update or append to any message on the channel +- `message-delete-own` := Can delete your own messages +- `message-delete-any` := Can delete any message on the channel ##### Returns -A successful request returns the updated @Message@ object with the new version information. - -See [MessageAction](/docs/api/realtime-sdk/types#message-action) for the possible values of the `action` enum. +Returns an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result), an object with a single `versionSerial` field: the serial of the version of the updated, deleted, or appended message, or `null` if the message was superseded by a subsequent update before it could be published. ```json { - serial: , - name: , - data: , - timestamp: , - clientId: , - action: , - version: { - serial: , - clientId: , - timestamp: , - description: , - metadata: - } -} -``` - - -An unsuccessful request returns an error. - -### Delete a message - -#### POST main.realtime.ably.net/channels/\/messages/\/delete - -Delete a message on a channel, the message with the specified serial. This is a 'soft' delete that publishes a new version of the message with an action of `message.delete`. The full message history remains accessible through the [message versions](message-versions) endpoint. This endpoint requires that the channel is configured with the "Message annotations, updates, and deletes" channel rule. - -See [Updating and deleting messages](/docs/messages/updates-deletes#update) for more information about message updates and field semantics. - -The request body contains the message fields to update, along with optional operation metadata. Any fields not specified will be left as their original values. - - -```json -{ - name: , - data: , - encoding: , - extras: , - operation: { - clientId: , - description: , - metadata: - } -} -``` - - -Example request: - - -```shell -curl -X POST https://main.realtime.ably.net/channels/rest-example/messages/01826232498871-001@abcdefghij:001/delete \ - -u "{{API_KEY}}" \ - -H "Content-Type: application/json" \ - --data \ - '{ - "operation": { - "description": "Content violation" - } - }' -``` - - -##### Options - -| Property | Value | -|----------|-------| -| Content-Type | `application/json`, `application/x-msgpack` or `application/x-www-form-urlencoded` | -| Accept | `application/json` by default, or `application/x-msgpack`, `text/html` | -| Auth required | yes ([basic](basic-authentication) or [token](token-authentication) with `message-delete-own` or `message-delete-any` capability) | - -##### Capabilities - -| Capability | Description | -|------------|-------------| -| `message-delete-own` | Can delete your own messages (messages where the original publisher's `clientId` matches the deleter's `clientId`, where both are [identified](/docs/auth/identified-clients)) | -| `message-delete-any` | Can delete any message on the channel | - -##### Returns - -A successful request returns the updated `Message` object with `action` set to `message.delete`. - -See [MessageAction](/docs/api/realtime-sdk/types#message-action) for the possible values of the `action` enum. - - -```shell -{ - serial: , - name: , - data: , - timestamp: , - clientId: , - action: , - version: { - serial: , - clientId: , - timestamp: , - description: , - metadata: - } + "versionSerial": "01826232512345-002@abcdefghij:002" } ``` diff --git a/src/pages/docs/api/rest-sdk/channels.mdx b/src/pages/docs/api/rest-sdk/channels.mdx index f57747d395..022178675c 100644 --- a/src/pages/docs/api/rest-sdk/channels.mdx +++ b/src/pages/docs/api/rest-sdk/channels.mdx @@ -473,6 +473,8 @@ On failure to retrieve message history, the `error` contains an [`ErrorInfo`](#e Retrieves the latest version of a specific message by its serial identifier. Requires the **history** [capability](/docs/auth/capabilities). +See [updating and deleting messages: retrieving the latest version](/docs/messages/updates-deletes#get) for more information. + ##### Parameters | Parameter | Description | Type | @@ -485,11 +487,11 @@ Returns a promise which, upon success, will be fulfilled with a [`Message`](/doc #### updateMessage -`updateMessage(message: Message, operation?: MessageOperation, params?: Record): Promise` +`updateMessage(message: Message, operation?: MessageOperation, params?: Record): Promise` -Publishes an update to an existing message with patch semantics. Non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-update-own** or **message-update-any** [capability](/docs/auth/capabilities). +Publishes an update to an existing message with shallow mixin semantics. Non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-update-own** or **message-update-any** [capability](/docs/auth/capabilities). -See [updating and deleting messages](/docs/messages/updates-deletes) for more information. +See [updating and deleting messages: updates](/docs/messages/updates-deletes#update) for more information. ##### Parameters @@ -501,15 +503,15 @@ See [updating and deleting messages](/docs/messages/updates-deletes) for more in ##### Returns -Returns a promise which, upon success, will be fulfilled. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. +Returns a promise which, upon success, will be fulfilled with an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. #### deleteMessage -`deleteMessage(message: Message, operation?: MessageOperation, params?: Record): Promise` +`deleteMessage(message: Message, operation?: MessageOperation, params?: Record): Promise` -Marks a message as deleted by publishing an update with an action of `MESSAGE_DELETE`. This does not remove the message from the server, and the full message history remains accessible. Uses patch semantics: non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-delete-own** or **message-delete-any** [capability](/docs/auth/capabilities). +Marks a message as deleted by publishing an update with an action of `MESSAGE_DELETE`. This does not remove the message from the server, and the full message history remains accessible. Uses shallow mixin semantics: non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-delete-own** or **message-delete-any** [capability](/docs/auth/capabilities). -See [updating and deleting messages](/docs/messages/updates-deletes) for more information. +See [updating and deleting messages: deletes](/docs/messages/updates-deletes#delete) for more information. ##### Parameters @@ -521,7 +523,29 @@ See [updating and deleting messages](/docs/messages/updates-deletes) for more in ##### Returns -Returns a promise which, upon success, will be fulfilled. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. +Returns a promise which, upon success, will be fulfilled with an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. + +#### appendMessage + +`appendMessage(message: Message, operation?: MessageOperation, params?: Record): Promise` + +Appends data to an existing message. The supplied `data` field is appended to the previous message's data, while all other fields (`name`, `extras`) replace the previous values if provided. Requires the **message-update-own** or **message-update-any** [capability](/docs/auth/capabilities). + +For publishing a high rate of appends, you typically want to use a realtime client, not a REST client, in order to have message order preservation. See [append ordering](/docs/messages/updates-deletes#append-ordering). + +See [updating and deleting messages: appends](/docs/messages/updates-deletes#append) for more information. + +##### Parameters + +| Parameter | Description | Type | +|-----------|-------------|------| +| message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field and the data to append | [`Message`](/docs/api/realtime-sdk/messages) | +| operation | An optional `MessageOperation` object containing metadata about the append operation. Can include `clientId`, `description`, and `metadata` fields | `MessageOperation` (optional) | +| params | Optional parameters sent as part of the query string | `Record` (optional) | + +##### Returns + +Returns a promise which, upon success, will be fulfilled with an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message. Upon failure, the promise will be rejected with an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error. #### getMessageVersions @@ -529,7 +553,7 @@ Returns a promise which, upon success, will be fulfilled. Upon failure, the prom Retrieves all historical versions of a specific message, ordered by version. This includes the original message and all subsequent updates or delete operations. Requires the **history** [capability](/docs/auth/capabilities). -See [updating and deleting messages](/docs/messages/updates-deletes) for more information. +See [updating and deleting messages: versions](/docs/messages/updates-deletes#versions) for more information. ##### Parameters @@ -590,7 +614,7 @@ This will typically be empty as all messages received from Ably are automaticall ### action -The action type of the message, one of the [`MessageAction`](/docs/api/realtime-sdk/types#message-action) enum values.
_Type: `enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, META, MESSAGE_SUMMARY }`_ +The action type of the message, one of the [`MessageAction`](/docs/api/realtime-sdk/types#message-action) enum values.
_Type: `enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, MESSAGE_APPEND, META, MESSAGE_SUMMARY }`_ ### serial
diff --git a/src/pages/docs/api/rest-sdk/types.mdx b/src/pages/docs/api/rest-sdk/types.mdx index 0f7a7b0e5d..646ef6c8f3 100644 --- a/src/pages/docs/api/rest-sdk/types.mdx +++ b/src/pages/docs/api/rest-sdk/types.mdx @@ -411,7 +411,7 @@ This will typically be empty as all messages received from Ably are automaticall #### action -The action type of the message, one of the [`MessageAction`](/docs/api/realtime-sdk/types#message-action) enum values.
_Type: `int enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, META, MESSAGE_SUMMARY }`_ +The action type of the message, one of the [`MessageAction`](/docs/api/realtime-sdk/types#message-action) enum values.
_Type: `int enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, META, MESSAGE_SUMMARY, MESSAGE_APPEND }`_ #### serial
diff --git a/src/pages/docs/channels/index.mdx b/src/pages/docs/channels/index.mdx index 908607717f..b0b6f0695d 100644 --- a/src/pages/docs/channels/index.mdx +++ b/src/pages/docs/channels/index.mdx @@ -200,7 +200,7 @@ The channel rules related to enabling features are: | Push notifications enabled | If checked, publishing messages with a push payload in the `extras` field is permitted. This triggers the delivery of a [Push Notification](/docs/push) to devices registered for push on the channel. | | Server-side batching | If enabled, messages are grouped into batches before being sent to subscribers. [Server-side batching](/docs/messages/batch#server-side) reduces the overall message count, lowers costs, and mitigates the risk of hitting rate limits during high-throughput scenarios. | | Message conflation | If enabled, messages are aggregated over a set period of time and evaluated against a conflation key. All but the latest message for each conflation key value will be discarded, and the resulting message, or messages, will be delivered to subscribers as a single batch once the period of time elapses. [Message conflation](/docs/messages#conflation) reduces costs in high-throughput scenarios by removing redundant and outdated messages. | -| Message annotations, updates, and deletes | If enabled, allows message "annotations":/docs/messages/annotations to be used, as well as updates and deletes to be published to messages. Note that these features are currently Experimental, still in development, and subject to change. When this feature is enabled, messages will be "persisted":/docs/storage-history/storage#all-message-persistence (necessary in order from them later be annotated or updated), and "continuous history":/docs/storage-history/history#continuous-history features will not work. +| Message annotations, updates, and deletes | If enabled, allows message "annotations":/docs/messages/annotations to be used, as well as updates and deletes to be published to messages. Note that these features are currently in public preview. When this feature is enabled, messages will be "persisted":/docs/storage-history/storage#all-message-persistence (necessary in order from them later be annotated or updated), and "continuous history":/docs/storage-history/history#continuous-history features will not work. To set a channel rule in the Ably dashboard: diff --git a/src/pages/docs/channels/options/index.mdx b/src/pages/docs/channels/options/index.mdx index 7f08fe1c02..9af33062d7 100644 --- a/src/pages/docs/channels/options/index.mdx +++ b/src/pages/docs/channels/options/index.mdx @@ -236,6 +236,22 @@ The [`rewind`](/docs/channels/options/rewind) feature enables clients to replay The [`delta`](/docs/channels/options/deltas) feature enables clients to subscribe to a channel so that message payloads only contain the difference, or delta, between the current and previous message. +### Append mode + +When using [message appends](/docs/messages/updates-deletes#append), subscribers receive incremental append payloads by default. Set `appendMode` to `full` to receive `update` messages, with the full message data so far in each message, instead of just the incremental `append`: + + +```realtime_javascript +const channelOpts = { params: { appendMode: 'full' } }; +const channel = realtime.channels.get('{{RANDOM_CHANNEL_NAME}}', channelOpts); +``` + +```realtime_nodejs +const channelOpts = { params: { appendMode: 'full' } }; +const channel = realtime.channels.get('{{RANDOM_CHANNEL_NAME}}', channelOpts); +``` + + ### Occupancy [Occupancy](/docs/presence-occupancy/occupancy) provides metrics about the clients attached to a channel, such as the number of connections and the number of clients subscribed to the channel. `occupancy` can be specified in the `params` property in order to subscribe a client to occupancy metrics for the channel. The metrics will be received by a client as events on the channel. diff --git a/src/pages/docs/messages/annotations.mdx b/src/pages/docs/messages/annotations.mdx index ef24b54124..4eafc6dd87 100644 --- a/src/pages/docs/messages/annotations.mdx +++ b/src/pages/docs/messages/annotations.mdx @@ -3,8 +3,8 @@ title: Message annotations meta_description: "Annotate messages on a channel with additional metadata." --- -