Skip to content

Commit

Permalink
ref(replay): Ensure we only clear for buffer mode (#8744)
Browse files Browse the repository at this point in the history
This _shouldn't_ happen, but it makes sense to guard so we only clear
the event buffer cache on checkouts when in `buffer` mode. I guess the
behavior of rrweb is not 100% defined in that it _cannot_ generate a new
checkout in non-buffer mode 🤔 better safe than sorry.
  • Loading branch information
mydea authored Aug 7, 2023
1 parent 88e9418 commit 4c6f62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/replay/src/util/addEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function addEvent(
}

try {
if (isCheckout) {
if (isCheckout && replay.recordingMode === 'buffer') {
replay.eventBuffer.clear();
}

Expand Down

0 comments on commit 4c6f62e

Please sign in to comment.