Skip to content

Commit

Permalink
feat(replay): Clear fallback buffer when switching buffers (#13914)
Browse files Browse the repository at this point in the history
Saw this while debugging, this should not have a big effect since the
fallback buffer should be relatively small.
  • Loading branch information
billyvg authored Oct 9, 2024
1 parent ed2e556 commit 37b45c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/replay-internal/src/eventBuffer/EventBufferProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export class EventBufferProxy implements EventBuffer {
// Wait for original events to be re-added before resolving
try {
await Promise.all(addEventPromises);

// Can now clear fallback buffer as it's no longer necessary
this._fallback.clear();
} catch (error) {
DEBUG_BUILD && logger.exception(error, 'Failed to add events when switching buffers.');
}
Expand Down

0 comments on commit 37b45c1

Please sign in to comment.