diff --git a/frontend/src/scenes/session-recordings/sessionReplaySceneLogic.ts b/frontend/src/scenes/session-recordings/sessionReplaySceneLogic.ts index 246fa495ba5a2..f2eb2a436c130 100644 --- a/frontend/src/scenes/session-recordings/sessionReplaySceneLogic.ts +++ b/frontend/src/scenes/session-recordings/sessionReplaySceneLogic.ts @@ -108,8 +108,13 @@ export const sessionReplaySceneLogic = kea([ urlToAction(({ actions, values }) => { return { '/replay/:tab': ({ tab }) => { - if (tab !== values.tab) { - actions.setTab(tab as ReplayTabs) + // we saw a page get stuck in a redirect loop between recent and home + // see https://posthog.sentry.io/issues/6176801992/?notification_uuid=093e1a3f-c266-4c17-9610-68816996d304&project=1899813&referrer=assigned_activity-email + // so, we're extra careful that the value being set is a valid tab + const candidateTab = tab as ReplayTabs + const validTab = Object.values(ReplayTabs).includes(candidateTab) ? candidateTab : ReplayTabs.Home + if (validTab !== values.tab) { + actions.setTab(validTab) } }, }