Skip to content

Commit

Permalink
leeory j
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Mar 21, 2024
1 parent d2d0ed0 commit 46b81c0
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import path from 'path'
import { KAFKA_SESSION_RECORDING_SNAPSHOT_ITEM_EVENTS } from '../../../config/kafka-topics'
import { PipelineEvent, RawEventMessage, RRWebEvent } from '../../../types'
import { status } from '../../../utils/status'
import { cloneObject } from '../../../utils/utils'
import { eventDroppedCounter } from '../metrics'
import { TeamIDWithConfig } from './session-recordings-consumer'
import { IncomingRecordingMessage, PersistedRecordingMessage } from './types'
Expand Down Expand Up @@ -257,10 +256,7 @@ export const reduceRecordingMessages = (messages: IncomingRecordingMessage[]): I
for (const message of messages) {
const key = `${message.team_id}-${message.session_id}`
if (!reducedMessages[key]) {
// cloning the object here so that when we mutate it
// we're not also mutating its reference in the inbound messages array
// this is maybe overly defensive, but better safe than sorry
reducedMessages[key] = cloneObject(message)
reducedMessages[key] = message
} else {
const existingMessage = reducedMessages[key]
for (const [windowId, events] of Object.entries(message.eventsByWindowId)) {
Expand Down

0 comments on commit 46b81c0

Please sign in to comment.