Skip to content

Commit

Permalink
ref: Do not keep previousSessionId
Browse files Browse the repository at this point in the history
We do not need it right now
  • Loading branch information
mydea committed Jul 13, 2023
1 parent 6887454 commit 97784ed
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
13 changes: 0 additions & 13 deletions packages/replay/src/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ export class ReplayContainer implements ReplayContainerInterface {
private _debouncedFlush: ReturnType<typeof debounce>;
private _flushLock: Promise<unknown> | 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?
*/
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand All @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions packages/replay/src/types/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
*/
Expand Down

0 comments on commit 97784ed

Please sign in to comment.