From 13ab6db456290c84fe6951daf84fc07e08e99b26 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Mon, 28 Aug 2023 17:15:57 -0400 Subject: [PATCH] fix(replay): Resume replay recording if paused when session is expired Previously was attempting to take full snapshot when replay recording was not active. Fixes https://github.com/getsentry/sentry-javascript/issues/8885 --- packages/replay/src/replay.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/replay/src/replay.ts b/packages/replay/src/replay.ts index eec3edf45083..660e5ffc6150 100644 --- a/packages/replay/src/replay.ts +++ b/packages/replay/src/replay.ts @@ -645,7 +645,11 @@ export class ReplayContainer implements ReplayContainerInterface { } // Session is expired, trigger a full snapshot (which will create a new session) - this._triggerFullSnapshot(); + if (this.isPaused()) { + this.resume(); + } else { + this._triggerFullSnapshot(); + } return false; }