Skip to content

Commit 2d5d5a0

Browse files
SimonWoolfclaude
andcommitted
Address Copilot review on annotations docs
- Drop the #summary-entry intra-page link for languages where the Summary entry types section is not rendered (csharp, go, flutter, ruby, php), so the row prose still works without a broken anchor. - Clarify which Annotation fields are user-settable when publishing vs server- or SDK-populated, rather than calling all non-(type, name, count, data) fields "server-set" — extras and encoding are user-settable, and action / messageSerial are SDK-set on publish. - Switch the messages/annotations.mdx paginated-result link from rest-sdk/types to realtime-sdk/types, matching the wider docs convention for cross-product guide pages (14 vs 6 references). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0a9166f commit 2d5d5a0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/pages/docs/api/realtime-sdk/types.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,15 +583,15 @@ An `Array` of [`Message`](/docs/api/realtime-sdk/types#message) objects
583583

584584
| Property | Description | Type |
585585
|----------|-------------|------|
586-
| summary | An object whose keys are [annotation types](/docs/messages/annotations#annotation-types), and whose values are aggregated [summary entries](#summary-entry) for that annotation type. The structure of each value depends on the summarization method, for example a `total.v1` entry will have a `total` field, while a `flag.v1` entry will have `total` and `clientIds` fields. See [annotation summaries](/docs/messages/annotations#annotation-summaries) for details | <If lang="javascript,nodejs">`Record<String, SummaryEntry>`</If><If lang="java">[`Summary`](#summary)</If><If lang="objc,swift">`NSDictionary<NSString *, NSDictionary *>`</If><If lang="python">`Dict[str, Dict]`</If><If lang="csharp,go,flutter,ruby,php">`Record<String, JsonObject>`</If> |
586+
| summary | An object whose keys are [annotation types](/docs/messages/annotations#annotation-types), and whose values are aggregated <If lang="javascript,nodejs,objc,swift,java,python">[summary entries](#summary-entry)</If><If lang="csharp,go,flutter,ruby,php">summary entries</If> for that annotation type. The structure of each value depends on the summarization method, for example a `total.v1` entry will have a `total` field, while a `flag.v1` entry will have `total` and `clientIds` fields. See [annotation summaries](/docs/messages/annotations#annotation-summaries) for details | <If lang="javascript,nodejs">`Record<String, SummaryEntry>`</If><If lang="java">[`Summary`](#summary)</If><If lang="objc,swift">`NSDictionary<NSString *, NSDictionary *>`</If><If lang="python">`Dict[str, Dict]`</If><If lang="csharp,go,flutter,ruby,php">`Record<String, JsonObject>`</If> |
587587

588588
<If lang="javascript,nodejs,objc,swift,java,python">
589589

590590
### <If lang="javascript,nodejs">Annotation</If><If lang="objc,swift">ARTAnnotation</If><If lang="java">io.ably.lib.types.Annotation</If><If lang="python">Annotation</If> <a id="annotation" />
591591

592592
An `Annotation` represents an individual annotation event for a message — either an `annotation.create` or `annotation.delete`.
593593

594-
The same type is used both for publishing an annotation and for receiving one. When publishing, only `type` is required; some annotation types additionally need `name` (and `count` for `multiple.v1`), and `data` is optional. The remaining fields are server-set, and are populated by Ably on annotations received via [`channel.annotations.subscribe`](/docs/api/realtime-sdk/channels#annotations-subscribe) or [`channel.annotations.get`](/docs/api/realtime-sdk/channels#annotations-get).
594+
The same type is used both for publishing an annotation and for receiving one. When publishing, only `type` is required; some annotation types additionally need `name` (and `count` for `multiple.v1`), and `data`, `extras`, and `encoding` are optional user-set fields. The other fields (`id`, `clientId`, `timestamp`, `serial`, `messageSerial`, `action`) are server- or SDK-populated, and are present on annotations received via [`channel.annotations.subscribe`](/docs/api/realtime-sdk/channels#annotations-subscribe) or [`channel.annotations.get`](/docs/api/realtime-sdk/channels#annotations-get). See the per-field descriptions below for details.
595595

596596
#### <If lang="javascript,nodejs,objc,swift">Properties</If><If lang="java">Members</If><If lang="python">Attributes</If>
597597

src/pages/docs/messages/annotations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ await channel.annotations.subscribe(annotation_handler)
801801

802802
## Retrieve annotations <a id="retrieve" />
803803

804-
To retrieve all annotations that have been published for a message, use the `annotations.get()` method on a channel. Pass in either a [message](/docs/messages) instance or the `serial` of the message. This returns a [paginated result](/docs/api/rest-sdk/types#paginated-result) containing every individual annotation event for that message, starting from the earliest. You can pass an optional `limit` to control the page size.
804+
To retrieve all annotations that have been published for a message, use the `annotations.get()` method on a channel. Pass in either a [message](/docs/messages) instance or the `serial` of the message. This returns a [paginated result](/docs/api/realtime-sdk/types#paginated-result) containing every individual annotation event for that message, starting from the earliest. You can pass an optional `limit` to control the page size.
805805

806806
<Aside data-type='note'>
807807
You should only use this method if you need the full list of individual, raw annotations. If you only need the latest [annotation summary](#annotation-summaries) for a message — for example on a channel you are not subscribed to, where you are not receiving `message.summary` updates — use [`channel.getMessage()`](/docs/messages/updates-deletes#get) instead. The returned message contains the up-to-date `annotations.summary`.

0 commit comments

Comments
 (0)