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
Update message / annotations docs for protocol v4 messages
And remove references to `version` for now until we add the
update/delete docs.
Our docs will just unconditionally use protocol v4 message docs for
annotations and updates, since by the time we release those features
experimentally all 3 sdks which had support for them will be updated to
v4.
Copy file name to clipboardExpand all lines: content/partials/types/_message.textile
+5-15Lines changed: 5 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ h6(#timestamp).
51
51
default: timestamp
52
52
csharp: Timestamp
53
53
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>__
55
55
56
56
h6(#encoding).
57
57
default: encoding
@@ -69,22 +69,12 @@ blang[jsall].
69
69
h6(#serial).
70
70
default: serial
71
71
72
-
This message's unique serial (an identifier that will be the same in all future updates of this message).<br>__Type: @String@__
72
+
The message's serial (a server-assigned identifier that will be the same in all future updates of this message, and can be used to add annotations). Right now this will only be set if you enable annotations in "channel rules":/docs/channels#rules .<br>__Type: @String@__
73
73
74
-
h6(#created-at).
75
-
default: createdAt
74
+
h6(#annotations).
75
+
default: annotations
76
76
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__
- <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>@__
Copy file name to clipboardExpand all lines: src/pages/docs/messages/annotations.mdx
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,7 @@ Annotations can be enabled for a channel or channel namespace with the *Message
24
24
Note that when message annotations are enabled, messages are [persisted](/docs/storage-history/storage#all-message-persistence) by default, and [continuous history](/docs/storage-history/history#continuous-history) features are not currently supported.
25
25
</Aside>
26
26
27
-
1. On your [dashboard](https://ably.com/accounts/any), select one of your apps.
28
-
2. Go to **Settings**.
27
+
1. Go to the [**Settings**](https://ably.com/accounts/any/apps/any/edit) tab of an app in your dashboard.
29
28
3. Under [channel rules](/docs/channels#rules), click **Add new rule**.
30
29
4. Enter the channel name or channel namespace on which to enable message annotations.
31
30
5. Check **Message annotations, updates, and deletes** to enable message annotations.
## Subscribe to annotation summaries <aid="subscribe" />
287
286
288
287
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.
289
288
290
-
Annotation summaries are delivered to subscribers as messages with an `action` of `message.summary`. These messages have a `summary` field which provides a summary of all the annotations for the message, identified by the `serial` field on the summary message.
289
+
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.
291
290
292
291
The value of the `summary` field is an object where the keys are the [annotation types](#annotation-types). The structure of the value of each key depends on the summarization method used, for example `total.v1` will have a `total` field, while `flag.v1` will have `total` and `clientIds` fields.
Copy file name to clipboardExpand all lines: src/pages/docs/messages/index.mdx
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,16 +27,15 @@ The following are the properties of a message:
27
27
|----------|-------------|
28
28
|**name**| The name of the message |
29
29
|**data**| The contents of the message. Also known as the message payload |
30
-
|**id**| Each message sent through Ably is assigned a unique ID, unless you provide your own ID. Client specified IDs ensure [publishes are idempotent](/docs/pub-sub/advanced#idempotency)|
30
+
|**id**| Each message sent through Ably is assigned a unique ID, unless you provide your own ID, which serves as the [idempotency key](/docs/pub-sub/advanced#idempotency)|
31
31
|**clientId**| The [ID of the client](/docs/auth/identified-clients) that published the message |
32
32
|**connectionId**| The ID of the connection used to publish the message |
33
-
|**timestamp**| The timestamp of when the message was received by Ably, as milliseconds since the Unix epoch |
33
+
|**timestamp**| The timestamp of when the message was first received by Ably, as milliseconds since the Unix epoch |
34
34
|**extras**| A JSON object of arbitrary key-value pairs that may contain metadata, and/or ancillary payloads. Valid payloads include those related to [Push Notifications](/docs/push), [deltas](/docs/channels/options/deltas) and headers |
35
35
|**encoding**| This is typically empty, as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute contains the remaining transformations not applied to the data payload |
36
-
37
-
<asidedata-type='note'>
38
-
Additional properties are included on a message when using message [annotations](/docs/messages/annotations) .
39
-
</aside>
36
+
|**action**| An [enum](/docs/api/realtime-sdk/types#message-action) telling you whether this is a normal ('create') message, an update to a previous message, an annotation summary, etc. |
37
+
|**serial**| The message's serial (a server-assigned identifier that will be the same in all future updates of this message, and can be used to add [annotations](/docs/messages/annotations)). Right now this will only be set if you enable annotations in [channel rules](/docs/channels#rules)|
38
+
|**annotations**| An object containing a summary of any [annotations](/docs/messages/annotations) that have been made to the message |
0 commit comments