Skip to content

Commit da1b592

Browse files
authored
fix(replay): Fix hasCheckout handling (#8782)
1. Make sure it is correctly kept when doing the compression worker switchover 2. Make sure it is correctly set for `session` recordings
1 parent dd6273e commit da1b592

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/replay/src/eventBuffer/EventBufferProxy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@ export class EventBufferProxy implements EventBuffer {
9999

100100
/** Switch the used buffer to the compression worker. */
101101
private async _switchToCompressionWorker(): Promise<void> {
102-
const { events } = this._fallback;
102+
const { events, hasCheckout } = this._fallback;
103103

104104
const addEventPromises: Promise<void>[] = [];
105105
for (const event of events) {
106106
addEventPromises.push(this._compression.addEvent(event));
107107
}
108108

109+
this._compression.hasCheckout = hasCheckout;
110+
109111
// We switch over to the new buffer immediately - any further events will be added
110112
// after the previously buffered ones
111113
this._used = this._compression;

packages/replay/src/util/addEvent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export async function addEvent(
5252
try {
5353
if (isCheckout && replay.recordingMode === 'buffer') {
5454
replay.eventBuffer.clear();
55+
}
56+
57+
if (isCheckout) {
5558
replay.eventBuffer.hasCheckout = true;
5659
}
5760

0 commit comments

Comments
 (0)