Skip to content

Commit

Permalink
Swap to concat for events
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Sep 5, 2024
1 parent 70c6ce8 commit d5bcbe2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d5bcbe2

Please sign in to comment.