Skip to content

Commit 1705482

Browse files
committed
Annotations docs: wording tweaks
requested by Paddy in #2642 post-merge
1 parent e565d85 commit 1705482

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/pages/docs/messages/annotations.mdx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,30 @@ meta_description: "Annotate messages on a channel with additional metadata."
44
---
55

66
<Aside data-type='experimental'>
7-
Message annotations are currently Experimental. They are still in development and subject to rapid change.
7+
Message annotations are currently Experimental, meaning the API or behaviour may change in response to customer feedback without a major SDK release.
88
</Aside>
99

10-
Message annotations enable clients to add metadata to existing messages on a channel. You can use annotations to implement features like:
10+
Message annotations enable clients to append information to existing messages on a channel. You can use annotations to implement features like:
1111

1212
* **Message reactions** - add emoji reactions (👍, ❤️, 😂) to messages
1313
* **Content categorization** - tag messages with categories such as "important" or "urgent"
1414
* **Community moderation** - flag inappropriate content for review
1515
* **Read receipts** - mark messages as "read" or "delivered"
16+
* **Comments** - clients can comment on a message, which will not show up in normal channel history, but which can be loaded on demand
1617

17-
When clients publish or delete an annotation, Ably automatically creates a [summary](#annotation-summaries) that provides an aggregated view of all annotations for that message.
18+
When clients publish or delete an annotation, Ably automatically creates a [summary](#annotation-summaries) that provides an aggregated view of all annotations for the associated message.
1819

1920
## Enable annotations <a id="enable"/>
2021

2122
Annotations can be enabled for a channel or channel namespace with the *Message annotations, updates, and deletes* channel rule.
2223

2324
<Aside data-type='important'>
24-
When message annotations are enabled, messages are [persisted](/docs/storage-history/storage#all-message-persistence) regardless of whether or not persistence is enabled, in order to support the feature. This may increase your package cost.
25+
When message annotations are enabled, messages are [persisted](/docs/storage-history/storage#all-message-persistence) regardless of whether or not persistence is enabled, in order to support the feature. This may increase your usage since [we charge for persisting messages](https://faqs.ably.com/how-does-ably-count-messages).
2526

2627
[Continuous history](/docs/storage-history/history#continuous-history) features are not supported. Be aware that if you are currently using continuous history and enable annotations, updates, and deletes, continuous history will no longer function.
2728
</Aside>
2829

29-
1. Go to the [**Settings**](https://ably.com/accounts/any/apps/any/edit) tab of an app in your dashboard.
30+
1. Go to the **Settings** tab of an app in your dashboard.
3031
3. Under [channel rules](/docs/channels#rules), click **Add new rule**.
3132
4. Enter the channel name or channel namespace on which to enable message annotations.
3233
5. Check **Message annotations, updates, and deletes** to enable message annotations.
@@ -38,7 +39,7 @@ Annotation types determine how annotations are processed and aggregated into [su
3839

3940
The annotation type is a string of the format `namespace:summarization.version` where:
4041

41-
* `namespace` is a string (e.g. `reactions`) that groups related annotations. Only annotations in the same namespace will be aggregated together to produce [summaries](#annotation-summaries).
42+
* `namespace` is a string (e.g. `reactions`) that groups related annotations. Only annotations in the same namespace will be aggregated to produce [summaries](#annotation-summaries).
4243
* `summarization` specifies how annotations are aggregated to produce [summaries](#annotation-summaries), such as `total`, `flag`, `distinct`, `unique`, or `multiple`.
4344
* `version` specifies the version component which allows for future changes to summarization behavior.
4445

@@ -251,13 +252,13 @@ await channel.annotations.publish(message.serial, {
251252
```
252253
</Code>
253254

254-
You can additionally specify a `data` payload when publishing an annotation. This is not included in an annotation summary, so only readable by someone [subscribing to individual annotation events](#individual-annotations).
255+
You can additionally specify a `data` payload when publishing an annotation. This is not included in an annotation summary, so only readable by [clients that are subscribed to individual annotation events](#individual-annotations).
255256

256257
## Delete annotations <a id="delete" />
257258

258259
To delete an annotation, use the `annotations.delete()` method on a channel. Pass in either a [message](/docs/messages) instance or the `serial` of the message to annotate. This method will publish an annotation message with an action of `annotation.delete`.
259260

260-
Deleting an annotation does not remove the original annotation that was published. Instead, they affect the [annotation summary](#annotation-summaries) for that message by removing the contribution specified by the annotation.
261+
Deleting an annotation does not remove the original annotation that was published. Instead, the deletion modifies the [annotation summary](#annotation-summaries) for that message by removing the contribution specified by the annotation.
261262

262263
The `clientId` specified in the [client options](/docs/api/realtime-sdk#client-options) will be associated with the published delete annotation.
263264

@@ -299,7 +300,7 @@ await channel.annotations.delete(message.serial, {
299300

300301
## Subscribe to annotation summaries <a id="subscribe" />
301302

302-
The recommended way to receive annotation updates is through annotation summaries. These events provide a summary of the complete, current state of all annotations for a message whenever an annotation is published or deleted.
303+
The simplest way to receive annotation updates is via annotation summaries. A message that has annotations also includes a summary which is a synopsis of certain details of all annotations for that message. Summaries are updated in response to further annotation events for that message, and summary changes are delivered by default to subscribing clients.
303304

304305
Annotation summaries are delivered to subscribers as messages with an `action` of `message.summary`, and a `serial` matching the `serial` of the message that they are updating. They have an `annotations` field which contains a `summary` of all the annotations for the message.
305306

@@ -419,13 +420,13 @@ If many clients publish the same annotation to the same message, the list of cli
419420
When a summary is clipped:
420421
- The `total` property shows the total number of annotations as expected, but the `clientIds` property will contain only a partial list of client IDs.
421422
- The `clipped` property is set to `true`.
422-
- For the `multiple` annotation type, use the `totalClientIds` property to determine the total number of clients that have published the annotation. For the other annotation types this is equal to `total`.
423+
- For the `multiple` annotation type, use the `totalClientIds` property to determine the total number of clients that have published the annotation. For the other annotation types this is equal to `total`.
423424

424425
## Subscribe to individual annotation events <a id="individual-annotations"/>
425426

426-
It is also possible to subscribe to individual annotation events, rather than annotation summaries. These are the emitted when [publishing](#publish) or [deleting](#delete) an annotation.
427+
It is also possible to subscribe to individual annotation events, as distinct from annotation summaries. These are the emitted when [publishing](#publish) or [deleting](#delete) an annotation.
427428

428-
Individual events can be useful for activity feeds or detailed logging, but generally, for most usecases, subscribed clients should rely on aggregated summaries. The aggregation of annotations for a message into a summary attached to the message is the primary benefit of using the annotations API; an app design oriented around every client needing to subscribe to raw annotation events may not be taking full advantage of the feature.
429+
Summaries are designed to address the most common usecases for annotations, so there is usually no need to subscribe to individual annotation events. However, subscribing to individual annotations is appropriate for usecases where the payload of individual annotation events is relevant to the application.
429430

430431
If you need to, you can subscribe to individual annotation events using the `annotations.subscribe()` method on a channel. To subscribe to individual annotations, you must request the `ANNOTATION_SUBSCRIBE` [mode](/docs/channels/options#modes).
431432

0 commit comments

Comments
 (0)