Skip to content

Commit

Permalink
Removed Serial definition and duplicate spec point.
Browse files Browse the repository at this point in the history
- Also fixed div not correctly graying out the spec point CHA-M4c
  • Loading branch information
splindsay-92 committed Nov 12, 2024
1 parent 36761e9 commit d99422d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions textile/chat-features.textile
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,6 @@ h2(#messages). Messages
Messages are the quintessential component of a chat room - the purpose of chat is for users to talk to each other!

Broadly speaking, messages are published via REST calls to the Chat HTTP API and message events are received in Realtime over a corresponding realtime channel.

@Serial@ is used to provide a global ordering for messages. A @Serial@ is a unique lexicographically sortable string.

* @(CHA-S1)@ @[Testable]@ In the context of lexicographical sorting, the following applies:
** @(CHA-S1a)@ @[Testable]@ A @Serial@ is considered before another @Serial@ in the global order if it comes first in a lexicographical sort.
** @(CHA-S1b)@ @[Testable]@ A @Serial@ is considered after another @Serial@ in the global order if it comes second in a lexicographical sort.
** @(CHA-S1c)@ @[Testable]@ A @Serial@ is considered to be equal to another @Serial@ if both @Serial@ strings are identical.

@Messages@ shall be exposed to consumers via the @messages@ property of a @Room@.

* @(CHA-M1)@ Chat messages for a Room are sent on a corresponding realtime channel @<roomId>::$chat::$chatMessages@. For example, if your room id is @my-room@ then the messages channel will be @my-room::$chat::$chatMessages@.
Expand All @@ -210,9 +202,9 @@ Broadly speaking, messages are published via REST calls to the Chat HTTP API and
** @(CHA-M2g)@ @[Testable]@ Two @Messages@ are considered to be the same if they have the same @serial@, that is to say, both @Serial@ strings are identical.
* @(CHA-M10)@ A @Message@ can be modified by applying a new @action@ to it, such as an update or delete. Applying an @action@ generates a new @Message@ instance with an updated @latestActionSerial@, while the original Message’s @serial@ remains unchanged.
** @(CHA-M10a)@ @[Testable]@ The @latestActionSerial@ of a @Message@ is a lexicographically sortable, unique identifier for each action applied to the @Message@. Unlike @serial@, @latestActionSerial@ is mutable and is updated each time an @action@ is applied.
** @(CHA-M10a)@ @[Testable]@ In global ordering, an @action@ is considered to occur before another @action@ if the @latestActionSerial@ of the first @action@ is lexicographically smaller than that of the latter.
** @(CHA-M10b)@ @[Testable]@ In global ordering, an @action@ is considered to occur after another @action@ if the @latestActionSerial@ of the first @action@ is lexicographically greater than that of the latter.
** @(CHA-M10c)@ @[Testable]@ Two @actions@ are considered to be the same if they have the same @latestActionSerial@, that is to say, both @latestActionSerial@ strings are identical.
** @(CHA-M10b)@ @[Testable]@ In global ordering, an @action@ is considered to occur before another @action@ if the @latestActionSerial@ of the first @action@ is lexicographically smaller than that of the latter.
** @(CHA-M10c)@ @[Testable]@ In global ordering, an @action@ is considered to occur after another @action@ if the @latestActionSerial@ of the first @action@ is lexicographically greater than that of the latter.
** @(CHA-M10d)@ @[Testable]@ Two @actions@ are considered to be the same if they have the same @latestActionSerial@, that is to say, both @latestActionSerial@ strings are identical.
* @(CHA-M3)@ A client must be able to send a message to a room via the Chat REST API.
** @(CHA-M3a)@ @[Testable]@ When a message is sent successfully, the caller shall receive a struct representing the "@Message@":#chat-structs-message in response, as if it were received via Realtime event.
** @(CHA-M3b)@ @[Testable]@ A message may be sent without @metadata@ or @headers@. When these are not specified by the user, they must be omitted from the REST payload.
Expand All @@ -229,9 +221,11 @@ Broadly speaking, messages are published via REST calls to the Chat HTTP API and
* @(CHA-M4)@ Messages can be received via a subscription in realtime.
** @(CHA-M4a)@ @[Testable]@ A subscription can be registered to receive incoming messages. Adding a subscription has no side effects on the status of the room or the underlying realtime channel.
** @(CHA-M4b)@ @[Testable]@ A subscription can de-registered from incoming messages. Removing a subscription has no side effects on the status of the room or the underlying realtime channel.

<div class=deprecated>
** @(CHA-M4c)@ @[Testable]@ @(deprecated)@ When a realtime message with @name@ set to @message.created@ is received, it is translated into a message event, which contains a @type@ field with the event type as well as a @message@ field containing the "@Message Struct@":#chat-structs-message. This event is then broadcast to all subscribers.
</div>

** @(CHA-M4l)@ @[Testable]@ When a realtime message with the @name@ field set to @chat.message@ is received, it is translated into a message event based on its @action@. This message event contains a @type@ field with the event type as well as a @message@ field containing the "@Message Struct@":#chat-structs-message-v2. This event is then broadcast to all subscribers.
** @(CHA-M4d)@ @[Testable]@ If a realtime message with an unknown @name@ is received, the SDK shall silently discard the message, though it may log at @DEBUG@ or @TRACE@ level.
** @(CHA-M4m)@ @[Testable]@ The @action@ field of the realtime message determines the type of chat message event that is emitted, based on the following rules.
Expand Down

0 comments on commit d99422d

Please sign in to comment.