Skip to content

Commit

Permalink
fix(session-replay): id increment
Browse files Browse the repository at this point in the history
Fix bug introduced by the eslint update in #879. Previously, the `++` operator was used, which increments the value after the variable is accessed. We switched to `+=` and moved it before the variable is used, causing issues with the indices.
  • Loading branch information
Joozty committed Nov 12, 2024
1 parent c205f18 commit 79126e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/session-recorder/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ const SplunkRumRecorder = {
}

const time = event.timestamp
eventCounter += 1
const eventI = eventCounter
eventCounter += 1

// Research found that stringifying the rr-web event here is
// more efficient for otlp + gzip exporting

Expand All @@ -226,13 +227,13 @@ const SplunkRumRecorder = {
for (let i = 0; i < totalC; i++) {
const start = i * MAX_CHUNK_SIZE
const end = (i + 1) * MAX_CHUNK_SIZE
logCounter += 1
const log = convert(decoder.decode(body.slice(start, end)), time, {
'rr-web.offset': logCounter,
'rr-web.event': eventI,
'rr-web.chunk': i + 1,
'rr-web.total-chunks': totalC,
})
logCounter += 1
if (debug) {
console.log(log)
}
Expand Down

0 comments on commit 79126e1

Please sign in to comment.