Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(chat) make reactions processing more resilient

Saúl Ibarra Corretgé4b93cbbd8d2a
diff --git a/react/features/chat/middleware.ts b/react/features/chat/middleware.ts
index 54e1535ead..6d341598b1 100644
--- a/react/features/chat/middleware.ts
+++ b/react/features/chat/middleware.ts
@@ -127,11 +127,14 @@ MiddlewareRegistry.register(store => next => action => {
const { participant, data } = action;
if (data?.name === ENDPOINT_REACTION_NAME) {
- store.dispatch(pushReactions(data.reactions));
+ // Skip duplicates, keep just 3.
+ const reactions = Array.from(new Set(data.reactions)).slice(0, 3) as string[];
+
+ store.dispatch(pushReactions(reactions));
_handleReceivedMessage(store, {
participantId: participant.getId(),
- message: getReactionMessageFromBuffer(data.reactions),
+ message: getReactionMessageFromBuffer(reactions),
privateMessage: false,
lobbyChat: false,
timestamp: data.timestamp