Skip to content

Commit 504be28

Browse files
authored
Merge pull request #2806 from ably/chat/clipped-summaries
add note about large reaction summaries getting clipped
2 parents 5100d76 + 52aa079 commit 504be28

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/pages/docs/chat/rooms/message-reactions.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,20 @@ Summary events are typically created and published immediately after a reaction
503503

504504
If multiple reactions are sent in a short period of time, multiple reactions may be rolled up and only a single summary event will be published that contains the aggregated results of all reactions. This reduces the number of outbound messages and thus your costs in busy rooms.
505505

506+
507+
<If lang="react,javascript">
508+
#### Large summaries <a id="large-summaries"/>
509+
510+
If many clients send the same reaction to the same message, the list of client IDs in that reaction summary will get clipped in order to keep the event size within the maximum message size.
511+
512+
When a summary is clipped:
513+
- The `total` property shows the total number of reactions as expected, but the `clientIds` property will contain only a partial list of client IDs.
514+
- The `clipped` property is set to `true`.
515+
- For the `multiple` reaction type, use the `totalClientIds` property to determine the total number of clients that have sent the reaction. For the other reaction types this is equal to `total`.
516+
517+
To determine if a particular client has reacted when the summary is clipped use `room.messages.reactions.clientReactions(message, clientId)`. It returns a custom clipped summary that contains the given clientId's reactions only.
518+
</If>
519+
506520
### Subscribing to raw reactions <a id="raw-reactions"/>
507521

508522
Raw individual reactions are published for every reaction, unlike summaries which can be rolled up. Raw reactions are useful for receiving all reaction events, but they are not suitable for the purpose of displaying message reaction counts as their effect on the reactions summary depends on the previous reactions.

0 commit comments

Comments
 (0)