File tree Expand file tree Collapse file tree 6 files changed +24
-12
lines changed
packages/replay-internal/src Expand file tree Collapse file tree 6 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,16 @@ export class EventBufferArray implements EventBuffer {
14
14
/** @inheritdoc */
15
15
public hasCheckout : boolean ;
16
16
17
+ /** @inheritdoc */
18
+ public waitForCheckout : boolean ;
19
+
17
20
private _totalSize : number ;
18
21
19
22
public constructor ( ) {
20
23
this . events = [ ] ;
21
24
this . _totalSize = 0 ;
22
25
this . hasCheckout = false ;
26
+ this . waitForCheckout = false ;
23
27
}
24
28
25
29
/** @inheritdoc */
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ export class EventBufferCompressionWorker implements EventBuffer {
16
16
/** @inheritdoc */
17
17
public hasCheckout : boolean ;
18
18
19
+ /** @inheritdoc */
20
+ public waitForCheckout : boolean ;
21
+
19
22
private _worker : WorkerHandler ;
20
23
private _earliestTimestamp : number | null ;
21
24
private _totalSize ;
@@ -25,6 +28,7 @@ export class EventBufferCompressionWorker implements EventBuffer {
25
28
this . _earliestTimestamp = null ;
26
29
this . _totalSize = 0 ;
27
30
this . hasCheckout = false ;
31
+ this . waitForCheckout = false ;
28
32
}
29
33
30
34
/** @inheritdoc */
Original file line number Diff line number Diff line change @@ -12,12 +12,6 @@ import { EventBufferCompressionWorker } from './EventBufferCompressionWorker';
12
12
* Exported only for testing.
13
13
*/
14
14
export class EventBufferProxy implements EventBuffer {
15
- /**
16
- * If the event buffer needs to wait for a checkout event before it
17
- * starts buffering events.
18
- */
19
- public waitForCheckout : boolean ;
20
-
21
15
private _fallback : EventBufferArray ;
22
16
private _compression : EventBufferCompressionWorker ;
23
17
private _used : EventBuffer ;
@@ -29,7 +23,11 @@ export class EventBufferProxy implements EventBuffer {
29
23
this . _used = this . _fallback ;
30
24
31
25
this . _ensureWorkerIsLoadedPromise = this . _ensureWorkerIsLoaded ( ) ;
32
- this . waitForCheckout = false ;
26
+ }
27
+
28
+ /** @inheritdoc */
29
+ public get waitForCheckout ( ) : boolean {
30
+ return this . _used . waitForCheckout ;
33
31
}
34
32
35
33
/** @inheritdoc */
Original file line number Diff line number Diff line change 1
1
import { getWorkerURL } from '@sentry-internal/replay-worker' ;
2
2
3
+ import type { EventBuffer } from '../types' ;
3
4
import { DEBUG_BUILD } from '../debug-build' ;
4
5
import { logger } from '../util/logger' ;
5
6
import { EventBufferArray } from './EventBufferArray' ;
@@ -19,7 +20,7 @@ declare const __SENTRY_EXCLUDE_REPLAY_WORKER__: boolean;
19
20
export function createEventBuffer ( {
20
21
useCompression,
21
22
workerUrl : customWorkerUrl ,
22
- } : CreateEventBufferParams ) : EventBufferProxy {
23
+ } : CreateEventBufferParams ) : EventBuffer {
23
24
if (
24
25
useCompression &&
25
26
// eslint-disable-next-line no-restricted-globals
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import type {
27
27
AddUpdateCallback ,
28
28
AllPerformanceEntry ,
29
29
AllPerformanceEntryData ,
30
+ EventBuffer ,
30
31
InternalEventContext ,
31
32
PopEventContext ,
32
33
RecordingEvent ,
@@ -57,13 +58,12 @@ import { sendReplay } from './util/sendReplay';
57
58
import { RateLimitError } from './util/sendReplayRequest' ;
58
59
import type { SKIPPED } from './util/throttle' ;
59
60
import { THROTTLED , throttle } from './util/throttle' ;
60
- import type { EventBufferProxy } from './eventBuffer/EventBufferProxy' ;
61
61
62
62
/**
63
63
* The main replay container class, which holds all the state and methods for recording and sending replays.
64
64
*/
65
65
export class ReplayContainer implements ReplayContainerInterface {
66
- public eventBuffer : EventBufferProxy | null ;
66
+ public eventBuffer : EventBuffer | null ;
67
67
68
68
public performanceEntries : AllPerformanceEntry [ ] ;
69
69
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import type {
9
9
Span ,
10
10
XhrBreadcrumbHint ,
11
11
} from '@sentry/types' ;
12
- import type { EventBufferProxy } from '../eventBuffer/EventBufferProxy' ;
13
12
14
13
import type { SKIPPED , THROTTLED } from '../util/throttle' ;
15
14
import type { AllPerformanceEntry , AllPerformanceEntryData , ReplayPerformanceEntry } from './performance' ;
@@ -401,6 +400,12 @@ export interface EventBuffer {
401
400
*/
402
401
hasCheckout : boolean ;
403
402
403
+ /**
404
+ * If the event buffer needs to wait for a checkout event before it
405
+ * starts buffering events.
406
+ */
407
+ waitForCheckout : boolean ;
408
+
404
409
/**
405
410
* Destroy the event buffer.
406
411
*/
@@ -450,7 +455,7 @@ export interface ReplayClickDetector {
450
455
}
451
456
452
457
export interface ReplayContainer {
453
- eventBuffer : EventBufferProxy | null ;
458
+ eventBuffer : EventBuffer | null ;
454
459
clickDetector : ReplayClickDetector | undefined ;
455
460
/**
456
461
* List of PerformanceEntry from PerformanceObservers.
You can’t perform that action at this time.
0 commit comments