From d5bcbe2769442c9fc0f3c90c3a1b37d7d5d15709 Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 5 Sep 2024 12:25:44 +0200 Subject: [PATCH] Swap to concat for events --- .../src/main/ingestion-queues/session-recording/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin-server/src/main/ingestion-queues/session-recording/utils.ts b/plugin-server/src/main/ingestion-queues/session-recording/utils.ts index 470905f58ac2d..a675c944129d6 100644 --- a/plugin-server/src/main/ingestion-queues/session-recording/utils.ts +++ b/plugin-server/src/main/ingestion-queues/session-recording/utils.ts @@ -337,13 +337,13 @@ export const parseKafkaBatch = async ( const newEventsByWindowId: IncomingRecordingMessage['eventsByWindowId'] = Object.entries( existingMessage.eventsByWindowId ).reduce((acc, [windowId, events]) => { - acc[windowId] = [...events] + acc[windowId] = ([] as RRWebEvent[]).concat(events) return acc }, {} as IncomingRecordingMessage['eventsByWindowId']) for (const [windowId, events] of Object.entries(parsedMessage.eventsByWindowId)) { newEventsByWindowId[windowId] = newEventsByWindowId[windowId] || [] - newEventsByWindowId[windowId].push(...events) + newEventsByWindowId[windowId].concat(events) } existingMessage.eventsByWindowId = newEventsByWindowId