File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,14 @@ export class EventBufferProxy implements EventBuffer {
49
49
}
50
50
51
51
/** @inheritDoc */
52
- public finish ( ) : Promise < ReplayRecordingData > {
52
+ public async finish ( ) : Promise < ReplayRecordingData > {
53
+ // Ensure the worker is loaded, so the sent event is compressed
54
+ try {
55
+ await this . ensureWorkerIsLoaded ( ) ;
56
+ } catch ( error ) {
57
+ // If this fails, we'll just send uncompressed events
58
+ }
59
+
53
60
return this . _used . finish ( ) ;
54
61
}
55
62
Original file line number Diff line number Diff line change @@ -330,18 +330,9 @@ export class ReplayContainer implements ReplayContainerInterface {
330
330
* from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
331
331
* cases of mulitple flushes happening closely together.
332
332
*/
333
- public async flushImmediate ( waitForCompression ?: boolean ) : Promise < void > {
333
+ public flushImmediate ( ) : Promise < void > {
334
334
this . _debouncedFlush ( ) ;
335
335
// `.flush` is provided by the debounced function, analogously to lodash.debounce
336
-
337
- // Ensure the worker is loaded, so the sent event is compressed
338
- if ( waitForCompression && this . eventBuffer instanceof EventBufferProxy ) {
339
- try {
340
- await this . eventBuffer . ensureWorkerIsLoaded ( ) ;
341
- } catch ( error ) {
342
- // If this fails, we'll just send uncompressed events
343
- }
344
- }
345
336
return this . _debouncedFlush . flush ( ) as Promise < void > ;
346
337
}
347
338
@@ -553,7 +544,7 @@ export class ReplayContainer implements ReplayContainerInterface {
553
544
// filtered on the UI.
554
545
if ( this . recordingMode === 'session' ) {
555
546
// We want to ensure the worker is ready, as otherwise we'd always send the first event uncompressed
556
- void this . flushImmediate ( true ) ;
547
+ void this . flushImmediate ( ) ;
557
548
}
558
549
559
550
return true ;
You can’t perform that action at this time.
0 commit comments