From 2991dc3ccf056ccdbfce408771efbddf7bb215cd Mon Sep 17 00:00:00 2001 From: zlshames Date: Wed, 8 Feb 2023 21:39:13 -0500 Subject: [PATCH] adds log when max payload size is reached --- .../server/src/server/api/v1/serializers/MessageSerializer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/server/src/server/api/v1/serializers/MessageSerializer.ts b/packages/server/src/server/api/v1/serializers/MessageSerializer.ts index 776524ac..a73af211 100644 --- a/packages/server/src/server/api/v1/serializers/MessageSerializer.ts +++ b/packages/server/src/server/api/v1/serializers/MessageSerializer.ts @@ -103,6 +103,10 @@ export class MessageSerializer { // If we've reached out max size, we need to clear the participants if (len > config.maxSizeBytes) { + Server().log( + `MessageSerializer: Max size reached (${config.maxSizeBytes} bytes). Clearing participants.`, + 'debug' + ); for (let i = 0; i < messageResponses.length; i++) { for (let c = 0; c < (messageResponses[i]?.chats ?? []).length; c++) { if (isEmpty(messageResponses[i].chats[c].participants)) continue;