Skip to content

Commit baaedcc

Browse files
committed
fix(replay): Call sendBufferedReplayOrFlush when opening/sending feedback
I noticed that our replays w/ feedbacks have gaps while the user is entering in their feedback. This is because we call `replay.flush` (not to be confused w/ the public replay integration integration which also has a flush) which only flushes the buffer and continues to buffer. What we want is to call `sendBufferedReplayOrFlush` which will convert the buffered replay into a session replay (after flushing) in order to continue recording.
1 parent eda7e33 commit baaedcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/replay-internal/src/util/addGlobalListeners.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ export function addGlobalListeners(replay: ReplayContainer): void {
6262
if (options?.includeReplay && replay.isEnabled() && replayId && feedbackEvent.contexts?.feedback) {
6363
// In case the feedback is sent via API and not through our widget, we want to flush replay
6464
if (feedbackEvent.contexts.feedback.source === 'api') {
65-
await replay.flush();
65+
await replay.sendBufferedReplayOrFlush();
6666
}
6767
feedbackEvent.contexts.feedback.replay_id = replayId;
6868
}
6969
});
7070

7171
client.on('openFeedbackWidget', async () => {
72-
await replay.flush();
72+
await replay.sendBufferedReplayOrFlush();
7373
});
7474
}
7575
}

0 commit comments

Comments
 (0)