Skip to content

Commit 338911c

Browse files
committed
ERROR_CHECKOUT_TIME --> BUFFER_CHECKOUT_TIME
1 parent 73b2034 commit 338911c

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

packages/replay/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const DEFAULT_FLUSH_MIN_DELAY = 5_000;
2424
export const DEFAULT_FLUSH_MAX_DELAY = 5_500;
2525

2626
/* How long to wait for error checkouts */
27-
export const ERROR_CHECKOUT_TIME = 60_000;
27+
export const BUFFER_CHECKOUT_TIME = 60_000;
2828

2929
export const RETRY_BASE_INTERVAL = 5000;
3030
export const RETRY_MAX_COUNT = 3;

packages/replay/src/replay.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { captureException, getCurrentHub } from '@sentry/core';
44
import type { Breadcrumb, ReplayRecordingMode } from '@sentry/types';
55
import { logger } from '@sentry/utils';
66

7-
import { ERROR_CHECKOUT_TIME, MAX_SESSION_LIFE, SESSION_IDLE_DURATION, WINDOW } from './constants';
7+
import { BUFFER_CHECKOUT_TIME, MAX_SESSION_LIFE, SESSION_IDLE_DURATION, WINDOW } from './constants';
88
import { setupPerformanceObserver } from './coreHandlers/performanceObserver';
99
import { createEventBuffer } from './eventBuffer';
1010
import { clearSession } from './session/clearSession';
@@ -152,7 +152,6 @@ export class ReplayContainer implements ReplayContainerInterface {
152152
}
153153

154154
/**
155-
<<<<<<< HEAD
156155
* Get the experimental options.
157156
* THIS IS INTERNAL AND SUBJECT TO CHANGE!
158157
* @hidden
@@ -204,9 +203,6 @@ export class ReplayContainer implements ReplayContainerInterface {
204203
/**
205204
* Start a replay regardless of sampling rate. Calling this will always
206205
* create a new session. Will throw an error if replay is already in progress.
207-
=======
208-
* Initializes the plugin.
209-
>>>>>>> develop
210206
*
211207
* Creates or loads a session, attaches listeners to varying events (DOM,
212208
* _performanceObserver, Recording, Sentry SDK, etc)
@@ -275,7 +271,7 @@ export class ReplayContainer implements ReplayContainerInterface {
275271
// When running in error sampling mode, we need to overwrite `checkoutEveryNms`
276272
// Without this, it would record forever, until an error happens, which we don't want
277273
// instead, we'll always keep the last 60 seconds of replay before an error happened
278-
...(this.recordingMode === 'buffer' && { checkoutEveryNms: ERROR_CHECKOUT_TIME }),
274+
...(this.recordingMode === 'buffer' && { checkoutEveryNms: BUFFER_CHECKOUT_TIME }),
279275
emit: getHandleRecordingEmit(this),
280276
onMutation: this._onMutationHandler,
281277
});

packages/replay/test/integration/errorSampleRate.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { captureException, getCurrentHub } from '@sentry/core';
22

33
import {
44
DEFAULT_FLUSH_MIN_DELAY,
5-
ERROR_CHECKOUT_TIME,
5+
BUFFER_CHECKOUT_TIME,
66
MAX_SESSION_LIFE,
77
REPLAY_SESSION_KEY,
88
SESSION_IDLE_DURATION,
@@ -529,7 +529,7 @@ describe('Integration | errorSampleRate', () => {
529529
});
530530

531531
it('has correct timestamps when error occurs much later than initial pageload/checkout', async () => {
532-
const ELAPSED = ERROR_CHECKOUT_TIME;
532+
const ELAPSED = BUFFER_CHECKOUT_TIME;
533533
const TEST_EVENT = { data: {}, timestamp: BASE_TIMESTAMP, type: 3 };
534534
mockRecord._emitter(TEST_EVENT);
535535

0 commit comments

Comments
 (0)