Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { shouldSampleForBufferEvent } from './util/shouldSampleForBufferEvent';
export function handleGlobalEventListener(replay: ReplayContainer): (event: Event, hint: EventHint) => Event | null {
return Object.assign(
(event: Event, hint: EventHint) => {
// Do nothing if replay has been disabled
if (!replay.isEnabled()) {
// Do nothing if replay has been disabled or paused
if (!replay.isEnabled() || replay.isPaused()) {
return event;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,23 @@ describe('Integration | coreHandlers | handleGlobalEvent', () => {

expect(handleGlobalEventListener(replay)(errorEvent, {})).toEqual(errorEvent);
});

it('does not add replayId if replay is paused', async () => {
const transaction = Transaction();
const error = Error();

replay['_isPaused'] = true;

expect(handleGlobalEventListener(replay)(transaction, {})).toEqual(
expect.not.objectContaining({
// no tags at all here by default
tags: expect.anything(),
}),
);
expect(handleGlobalEventListener(replay)(error, {})).toEqual(
expect.objectContaining({
tags: expect.not.objectContaining({ replayId: expect.anything() }),
}),
);
});
});
Loading