Skip to content

Commit 1601a24

Browse files
committed
undo some unnecessary changes and lint
1 parent ba73d92 commit 1601a24

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

packages/replay/src/eventBuffer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ class EventBufferArray implements EventBuffer {
7373

7474
public finish(): Promise<string> {
7575
return new Promise<string>(resolve => {
76-
resolve(
77-
this._finish());
76+
resolve(this._finish());
7877
});
7978
}
8079

packages/replay/src/integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
170170
return;
171171
}
172172

173-
void this._replay.start();
173+
this._replay.start();
174174
}
175175

176176
/**

packages/replay/src/replay.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable max-lines */ // TODO: We might want to split this file up
22
import { addGlobalEventProcessor, captureException, getCurrentHub } from '@sentry/core';
3-
import type { Breadcrumb, ReplayRecordingMode, ReplayRecordingData } from '@sentry/types';
3+
import type { Breadcrumb, ReplayRecordingData, ReplayRecordingMode } from '@sentry/types';
44
import type { RateLimits } from '@sentry/utils';
55
import { addInstrumentationHandler, disabledUntil, logger } from '@sentry/utils';
66
import { EventType, record } from 'rrweb';
@@ -20,6 +20,7 @@ import type {
2020
AddUpdateCallback,
2121
AllPerformanceEntry,
2222
EventBuffer,
23+
FlushOptions,
2324
InstrumentationTypeBreadcrumb,
2425
InternalEventContext,
2526
PopEventContext,
@@ -28,7 +29,6 @@ import type {
2829
ReplayContainer as ReplayContainerInterface,
2930
ReplayPluginOptions,
3031
Session,
31-
FlushOptions,
3232
} from './types';
3333
import { addEvent } from './util/addEvent';
3434
import { addMemoryEntry } from './util/addMemoryEntry';
@@ -152,7 +152,7 @@ export class ReplayContainer implements ReplayContainerInterface {
152152
* Creates or loads a session, attaches listeners to varying events (DOM,
153153
* _performanceObserver, Recording, Sentry SDK, etc)
154154
*/
155-
public async start(): Promise<void> {
155+
public start(): void {
156156
this._setInitialState();
157157

158158
this._loadSession({ expiry: SESSION_IDLE_DURATION });
@@ -625,7 +625,7 @@ export class ReplayContainer implements ReplayContainerInterface {
625625
// Send replay when the page/tab becomes hidden. There is no reason to send
626626
// replay if it becomes visible, since no actions we care about were done
627627
// while it was hidden
628-
this._conditionalFlush({finishImmediate: true});
628+
this._conditionalFlush({ finishImmediate: true });
629629
}
630630

631631
/**
@@ -818,7 +818,7 @@ export class ReplayContainer implements ReplayContainerInterface {
818818
promises.push(this._addPerformanceEntries());
819819

820820
// Do not continue if there are no pending events in buffer
821-
if (!this.eventBuffer?.pendingLength) {
821+
if (!this.eventBuffer || !this.eventBuffer.pendingLength) {
822822
return;
823823
}
824824

@@ -857,7 +857,7 @@ export class ReplayContainer implements ReplayContainerInterface {
857857
recordingData = await this.eventBuffer.finish();
858858
}
859859

860-
const sendReplayPromise = sendReplay({
860+
await sendReplay({
861861
replayId,
862862
recordingData,
863863
segmentId,
@@ -867,10 +867,6 @@ export class ReplayContainer implements ReplayContainerInterface {
867867
options: this.getOptions(),
868868
timestamp: new Date().getTime(),
869869
});
870-
871-
await sendReplayPromise;
872-
873-
return;
874870
} catch (err) {
875871
this._handleException(err);
876872

packages/replay/src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface SendReplayData {
2727
options: ReplayPluginOptions;
2828
}
2929

30-
export type PendingReplayData = Omit<SendReplayData, 'recordingData'|'session'|'options'> & {
30+
export type PendingReplayData = Omit<SendReplayData, 'recordingData' | 'session' | 'options'> & {
3131
recordingData: RecordingEvent[];
3232
};
3333

@@ -252,8 +252,8 @@ export interface EventBuffer {
252252
finish(): Promise<ReplayRecordingData>;
253253

254254
/**
255-
* Clears and synchronously returns the pending contents of the buffer. This means no compression.
256-
*/
255+
* Clears and synchronously returns the pending contents of the buffer. This means no compression.
256+
*/
257257
finishImmediate(): string;
258258
}
259259

0 commit comments

Comments
 (0)