Skip to content

Commit

Permalink
fix(replay): Fix hasCheckout handling (#8782)
Browse files Browse the repository at this point in the history
1. Make sure it is correctly kept when doing the compression worker
switchover
2. Make sure it is correctly set for `session` recordings
  • Loading branch information
mydea authored Aug 10, 2023
1 parent dd6273e commit da1b592
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/replay/src/eventBuffer/EventBufferProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ export class EventBufferProxy implements EventBuffer {

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

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

this._compression.hasCheckout = hasCheckout;

// We switch over to the new buffer immediately - any further events will be added
// after the previously buffered ones
this._used = this._compression;
Expand Down
3 changes: 3 additions & 0 deletions packages/replay/src/util/addEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export async function addEvent(
try {
if (isCheckout && replay.recordingMode === 'buffer') {
replay.eventBuffer.clear();
}

if (isCheckout) {
replay.eventBuffer.hasCheckout = true;
}

Expand Down

0 comments on commit da1b592

Please sign in to comment.