From 97784ed2b9349162d86b3e6378d96b9870284f82 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 28 Jun 2023 10:38:12 +0200 Subject: [PATCH] ref: Do not keep `previousSessionId` We do not need it right now --- packages/replay/src/replay.ts | 13 ------------- packages/replay/src/types/replay.ts | 6 ------ 2 files changed, 19 deletions(-) diff --git a/packages/replay/src/replay.ts b/packages/replay/src/replay.ts index df4b398ac112..43d4f97cb1f5 100644 --- a/packages/replay/src/replay.ts +++ b/packages/replay/src/replay.ts @@ -107,9 +107,6 @@ export class ReplayContainer implements ReplayContainerInterface { private _debouncedFlush: ReturnType; private _flushLock: Promise | null = null; - /** We keep this here in order to be able to connect sessions after .stop() is called. */ - private _previousSessionId: string | undefined; - /** * Is the integration currently active? */ @@ -327,7 +324,6 @@ export class ReplayContainer implements ReplayContainerInterface { this.eventBuffer = null; // Clear session from session storage - this._previousSessionId = this.getSessionId(); clearSession(this); } catch (err) { this._handleException(err); @@ -570,7 +566,6 @@ export class ReplayContainer implements ReplayContainerInterface { */ private _initializeSession(sampled: Sampled, { forceSampled = false }: { forceSampled?: boolean } = {}): void { const { stickySession } = this._options; - const previousSessionId = this._previousSessionId; // If neither sample rate is > 0, then do nothing - user will need to call one of // `start()` or `startBuffering` themselves. @@ -586,14 +581,6 @@ export class ReplayContainer implements ReplayContainerInterface { } this.session = session; - - // If previously a session was stopped, we temp. store the previousSessionId on the replay container. - // If this is set, we restore it when initializing a new session - if (previousSessionId) { - this.session.previousSessionId = previousSessionId; - this._maybeSaveSession(); - } - this.recordingMode = this.session.sampled === 'buffer' ? 'buffer' : 'session'; return; diff --git a/packages/replay/src/types/replay.ts b/packages/replay/src/types/replay.ts index 320a36719022..0cda7108413e 100644 --- a/packages/replay/src/types/replay.ts +++ b/packages/replay/src/types/replay.ts @@ -338,12 +338,6 @@ export interface Session { */ segmentId: number; - /** - * The ID of the previous session. - * If this is empty, there was no previous session. - */ - previousSessionId?: string; - /** * Is the session sampled? `false` if not sampled, otherwise, `session` or `buffer` */