You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Content categorization** - tag messages with categories such as "important" or "urgent"
14
14
***Community moderation** - flag inappropriate content for review
15
15
***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
16
17
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.
18
19
19
20
## Enable annotations <aid="enable"/>
20
21
21
22
Annotations can be enabled for a channel or channel namespace with the *Message annotations, updates, and deletes* channel rule.
22
23
23
24
<Asidedata-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).
25
26
26
27
[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.
27
28
</Aside>
28
29
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.
30
31
3. Under [channel rules](/docs/channels#rules), click **Add new rule**.
31
32
4. Enter the channel name or channel namespace on which to enable message annotations.
32
33
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
38
39
39
40
The annotation type is a string of the format `namespace:summarization.version` where:
40
41
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).
42
43
*`summarization` specifies how annotations are aggregated to produce [summaries](#annotation-summaries), such as `total`, `flag`, `distinct`, `unique`, or `multiple`.
43
44
*`version` specifies the version component which allows for future changes to summarization behavior.
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).
255
256
256
257
## Delete annotations <aid="delete" />
257
258
258
259
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`.
259
260
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.
261
262
262
263
The `clientId` specified in the [client options](/docs/api/realtime-sdk#client-options) will be associated with the published delete annotation.
## Subscribe to annotation summaries <aid="subscribe" />
301
302
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.
303
304
304
305
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.
305
306
@@ -419,13 +420,13 @@ If many clients publish the same annotation to the same message, the list of cli
419
420
When a summary is clipped:
420
421
- The `total` property shows the total number of annotations as expected, but the `clientIds` property will contain only a partial list of client IDs.
421
422
- 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`.
423
424
424
425
## Subscribe to individual annotation events <aid="individual-annotations"/>
425
426
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.
427
428
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.
429
430
430
431
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).
0 commit comments