Skip to content

Commit fa9d17b

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 12ac49a commit fa9d17b

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
@@ -65,15 +65,15 @@ export function addGlobalListeners(
6565
if (options?.includeReplay && replay.isEnabled() && replayId && feedbackEvent.contexts?.feedback) {
6666
// In case the feedback is sent via API and not through our widget, we want to flush replay
6767
if (feedbackEvent.contexts.feedback.source === 'api' && autoFlushOnFeedback) {
68-
await replay.flush();
68+
await replay.sendBufferedReplayOrFlush();
6969
}
7070
feedbackEvent.contexts.feedback.replay_id = replayId;
7171
}
7272
});
7373

7474
if (autoFlushOnFeedback) {
7575
client.on('openFeedbackWidget', async () => {
76-
await replay.flush();
76+
await replay.sendBufferedReplayOrFlush();
7777
});
7878
}
7979
}

0 commit comments

Comments
 (0)