Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions textile/features.textile
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ h3(#realtime-channel). RealtimeChannel
*** @(RTL6c5)@ A publish should not trigger an implicit attach (in contrast to earlier version of this spec)
** @(RTL6d)@ The protocol permits @Message@ s that have been queued to be sent in a single @ProtocolMessage@ , by bundling them into the @ProtocolMessage#messages@ or @ProtocolMessage#presence@ array. In general, the client library SHOULD NOT do this. If it does, it MUST conform to all of the following constraints:
*** @(RTL6d1)@ The resulting @ProtocolMessage@ must not exceed the @maxMessageSize@
*** @(RTL6d8)@ The resulting @ProtocolMessage@ must not contain more than 999 @Messages@
*** @(RTL6d2)@ Messages can only be bundled together if they have the same @clientId@ value (or both have no @clientId@ set). (Note that this constraint only applies to what the client library can autonomously do as part of queuing messages, not to what the user can do by publishing an array of @Messages@. It exists because if any @Message@ in a @ProtocolMessage@ has an invalid @clientId@, the entire @ProtocolMessage@ is rejected. This is fine if the user has deliberately published the @Messages@ together – they requested atomicity – but not if the client library has bundled them without the user's knowledge)
*** @(RTL6d3)@ Messages can only be bundled together if they are for the same @channel@
*** @(RTL6d4)@ Messages can only be bundled together if they are of the same type (that is, @Message@ versus @PresenceMessage@)
Expand Down Expand Up @@ -1332,17 +1333,17 @@ h4. Message
** @(TM2d)@ @data@ string, buffer or JSON-encodable object or array
** @(TM2e)@ @encoding@ string
** @(TM2i)@ @extras@ JSON-encodable object, used to contain any arbitrary key value pairs which may also contain other primitive JSON types, JSON-encodable objects or JSON-encodable arrays. The @extras@ field is provided to contain message metadata and/or ancillary payloads in support of specific functionality, e.g. push. Each of these supported extensions is documented separately; for 1.1 the only supported extension is @push@, via the @extras.push@ member; 1.2 adds the @delta@ extension whose keys and values are described by the attributes of the type @DeltaExtras@, and the @headers@ extension, which contains arbitrary @string->string@ key-value pairs, settable at publish time, and @ref@ whose keys and values are described by the attributes of the type @ReferenceExtras@. Unless otherwise specified, the client library should not attempt to do any filtering or validation of the @extras@ field itself, but should treat it opaquely, encoding it and passing it to realtime unaltered.
** @(TM2f)@ @timestamp@ time in milliseconds since epoch. If a message received from Ably does not contain a @timestamp@, it should be set to the @timestamp@ of the encapsulating @ProtocolMessage@
** @(TM2f)@ @timestamp@ time in milliseconds since epoch. If a message received from Ably over a realtime transport does not contain a @timestamp@, the SDK must set it to the @timestamp@ of the encapsulating @ProtocolMessage@
** @(TM2j)@ @action@ enum
** @(TM2k)@ @serial@ string - an opaque string that uniquely identifies the message.
** @(TM2p)@ @version@ string - an opaque string that uniquely identifies the message, and is different for different versions. If a message received from Ably over a realtime transport does not contain a @version@, the SDK must set it to @<channelSerial>:<padded_index>@ from the @channelSerial@ field of the enclosing @ProtocolMessage@, and @padded_index@ is the index of the message inside the @messages@ array of the @ProtocolMessage@, left-padded with 0s to three digits (for example, the second entry might be @foo:001@).
** @(TM2k)@ @serial@ string - an opaque string that uniquely identifies the message. If a message received from Ably (whether over realtime or REST, eg history) with an @action@ of @MESSAGE_CREATE@ does not contain a @serial@, the SDK must set it equal to its @TM2p@ @version@.
** @(TM2o)@ @createdAt@ time in milliseconds since epoch. If a message received from Ably (whether over realtime or REST, eg history) with an @action@ of @MESSAGE_CREATE@ does not contain a @createdAt@, the SDK must set it equal to the @TM2f@ @timestamp@.
** @(TM2l)@ @refSerial@ string - an opaque string that uniquely identifies some referenced message.
** @(TM2m)@ @refType@ string - an opaque string that identifies the type of this reference.
** @(TM2n)@ @operation@ - object that may contain the following `optional` attributes;
*** @(TM2n1)@ @clientId@ string
*** @(TM2n2)@ @description@ string
*** @(TM2n3)@ @metadata@ object - used to contain any arbitrary key value pairs of type string.
** @(TM2o)@ @updatedAt@ time in milliseconds since epoch at which an operation occurred. This field is always populated on messages received with an @action@ of @MESSAGE_UPDATE@ or @MESSAGE_DELETE@..
** @(TM2p)@ @updateSerial@ string - an opaque string that uniquely identifies the operation. This field is always populated on messages received with an @action@ of @MESSAGE_UPDATE@ or @MESSAGE_DELETE@.
* @(TM4)@ @Message@ has constructors @constructor(name: String?, data: Data?)@ and @constructor(name: String?, data: Data?, clientId: String?)@.
* @(TM3)@ @fromEncoded@ and @fromEncodedArray@ are alternative constructors that take an (already deserialized) @Message@-like object (or array of such objects), and optionally a @channelOptions@, and return a @Message@ (or array of such @Messages@) that's decoded and decrypted as specified in @RSL6@, using the cipher in the @channelOptions@ if the message is encrypted, with any residual transforms (ones that the library cannot decode or decrypt) left in the @encoding@ property per @RSL6b@. This is intended for users receiving messages other than from a REST or Realtime channel (for example, from a queue), to avoid them having to parse the @encoding@ string themselves.

Expand Down Expand Up @@ -2171,13 +2172,13 @@ enum PresenceAction: // TP2
UPDATE // TP2

enum MessageAction: // TM5
MESSAGE_UNSET // TM5
MESSAGE_CREATE // TM5
MESSAGE_UPDATE // TM5
MESSAGE_DELETE // TM5
ANNOTATION_CREATE // TM5
ANNOTATION_DELETE // TM5
META_OCCUPANCY // TM5
MESSAGE_UNSET // TM5
MESSAGE_CREATE // TM5
MESSAGE_UPDATE // TM5
MESSAGE_DELETE // TM5
ANNOTATION_CREATE // TM5
ANNOTATION_DELETE // TM5
META_OCCUPANCY // TM5

class ConnectionDetails: // CD*, internal
clientId: String? // RSA12a, CD2a
Expand All @@ -2204,12 +2205,12 @@ class Message: // TM*
name: String? // TM2g
timestamp: Time // TM2f
action: MessageAction // TM2j
serial: string // TM2K
refSerial: string? // TM2L
refType: string? // TM2M
operation: Object // TM2N
updatedAt: Time? // TM2O
updateSerial: string? // TM2P
serial: string // TM2k
version: string? // TM2p
refSerial: string? // TM2l
refType: string? // TM2m
operation: Object? // TM2n
createdAt: Time? // TM2o

class PresenceMessage // TP*
+fromEncoded(JsonObject, ChannelOptions?) -> PresenceMessage // TP4
Expand Down