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