Skip to content

Commit c36377b

Browse files
mschristensenSimonWoolfvladvelici
authored
Docs for annotations
* Add annotations docs * Add .claude to gitignore * Update message / annotations docs for protocol v4 messages * Add clipped flag to annotations doc --------- Co-authored-by: Simon Woolf <[email protected]> Co-authored-by: Vlad Velici <[email protected]>
1 parent 208e830 commit c36377b

File tree

15 files changed

+550
-30
lines changed

15 files changed

+550
-30
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ config/nginx-redirects.conf
2222
src/gatsby-types.d.ts
2323
.idea/*
2424
**/*.swp
25+
.claude

content/api/realtime-sdk/messages.textile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ h2(#properties).
2525
python: Attributes
2626

2727
<%= partial partial_version('types/_message') %>
28+
29+
h2(#message-annotations).
30+
default: MessageAnnotations
31+
32+
<%= partial partial_version('types/_message_annotations') %>

content/api/realtime-sdk/types.textile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ blang[jsall].
8787

8888
<%= partial partial_version('types/_message_action') %>
8989

90-
h3(#message-operation).
91-
default: Operation
90+
h3(#message-annotations).
91+
default: MessageAnnotations
9292

93-
<%= partial partial_version('types/_operation') %>
93+
<%= partial partial_version('types/_message_annotations') %>
9494

9595
h3(#presence-message).
9696
default: PresenceMessage

content/partials/core-features/_authentication_capabilities.textile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The following capability operations are available for API keys and issued tokens
55
- presence := can register presence on a channel (enter, update and leave)
66
- object-subscribe := can subscribe to updates to objects on a channel
77
- object-publish := can update objects on a channel
8+
- annotation-subscribe := can subscribe to individual annotations on a channel
9+
- annotation-publish := can publish annotations to messages on a channel
810
- history := can retrieve message and presence state history on channels
911
- stats := can retrieve current and historical usage statistics for an app
1012
- push-subscribe := can subscribe devices for push notifications

content/partials/types/_message.textile

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ h6(#timestamp).
5151
default: timestamp
5252
csharp: Timestamp
5353

54-
Timestamp when the message was received by the Ably, as <span lang="default">milliseconds since the epoch</span><span lang="ruby">a @Time@ object</span><br>.__Type: <span lang="default">@Integer@</span><span lang="java">@Long Integer@</span><span lang="csharp">@DateTimeOffset@</span><span lang="ruby">@Time@</span><span lang="objc,swift">@NSDate@</span>__
54+
Timestamp when the message was first received by the Ably, as <span lang="default">milliseconds since the epoch</span><span lang="ruby">a @Time@ object</span><br>.__Type: <span lang="default">@Integer@</span><span lang="java">@Long Integer@</span><span lang="csharp">@DateTimeOffset@</span><span lang="ruby">@Time@</span><span lang="objc,swift">@NSDate@</span>__
5555

5656
h6(#encoding).
5757
default: encoding
@@ -69,22 +69,12 @@ blang[jsall].
6969
h6(#serial).
7070
default: serial
7171

72-
This message's unique serial (an identifier that will be the same in all future updates of this message).<br>__Type: @String@__
72+
A server-assigned identifier that will be the same in all future updates of this message. It can be used to add annotations to a message. Serial will only be set if you enable annotations in "channel rules":/docs/channels#rules .<br>__Type: @String@__
7373

74-
h6(#created-at).
75-
default: createdAt
74+
h6(#annotations).
75+
default: annotations
7676

77-
The timestamp of the very first version of a given message (will differ from @timestamp@ only if the message has been updated or deleted).<br>__Type: @Integer@__
78-
79-
h6(#version).
80-
default: version
81-
82-
The version of the message, lexicographically-comparable with other versions (that share the same serial). Will differ from the serial only if the message has been updated or deleted.<br>__Type: @String@__
83-
84-
h6(#operation).
85-
default: operation
86-
87-
In the case of an updated or deleted message, this will contain metadata about the update or delete operation.<br>__Type: "@Operation@":/docs/api/realtime-sdk/types#message-operation__
77+
An object containing information about annotations that have been made to the object.<br>__Type: "@MessageAnnotations@":/docs/api/realtime-sdk/types#message-annotations__
8878

8979
h3(constructors).
9080
default: Message constructors
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
h4.
2+
default: Properties
3+
java: Members
4+
ruby: Attributes
5+
python: Attributes
6+
7+
- <span lang="default">summary</span> := An object whose keys are annotation types, and the values are aggregated summaries for that annotation type<br>__Type: @Record<String, JsonObject>@__

content/partials/types/_operation.textile

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/data/nav/pubsub.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ export default {
195195
name: 'Message batching',
196196
link: '/docs/messages/batch',
197197
},
198+
{
199+
name: 'Message annotations',
200+
link: '/docs/messages/annotations',
201+
},
198202
],
199203
},
200204
{

src/pages/docs/auth/capabilities.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ The following capability operations are available for API keys and issued tokens
4040
| **presence** | Can register presence on a channel (enter, update and leave) |
4141
| **object-subscribe** | Can subscribe to updates to objects on a channel |
4242
| **object-publish** | Can update objects on a channel |
43+
| **annotation-subscribe** | Can subscribe to individual annotations on a channel |
44+
| **annotation-publish** | Can publish annotations to messages on a channel |
4345
| **history** | Can retrieve message and presence state history on channels |
4446
| **stats** | Can retrieve current and historical usage statistics for an app |
4547
| **push-subscribe** | Can subscribe devices for push notifications |

src/pages/docs/channels/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ The channel rules related to enabling features are:
200200
| 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. |
201201
| 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. |
202202
| 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. |
203+
| 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.
203204

204205
To set a channel rule in the Ably dashboard:
205206

0 commit comments

Comments
 (0)