Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(onboarding): guard wizard heartbeat against unmounted stream logic (#61968)

Sam Penningtond11031d9c9e0
diff --git a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.ts b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.ts
index 4651ff6eba21..ef3e44884b97 100644
--- a/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.ts
+++ b/frontend/src/scenes/onboarding/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.ts
@@ -234,6 +234,16 @@ export const wizardProgressTrackerLogic = kea<wizardProgressTrackerLogicType>([
}, 'tick')
cache.disposables.add(() => {
const id = window.setInterval(() => {
+ // The kea-disposables plugin pauses timers when the tab is hidden and
+ // re-creates them on resume. That re-created interval can fire during a
+ // window where the connected wizardSessionStreamLogic has been torn down
+ // (e.g. the FAB unmounting after a feature-flag re-evaluation). Reading a
+ // value off an unmounted logic throws
+ // `[KEA] Can not find path "...wizardSessionStreamLogic..." in the store.`,
+ // so bail out unless the stream logic is currently mounted.
+ if (!wizardSessionStreamLogic.findMounted({ workflowId: WORKFLOW_ID })) {
+ return
+ }
// Heartbeat: if the log has gone quiet for HEARTBEAT_QUIET_THRESHOLD_MS
// while the wizard is still running, append a "still working" line so
// the panel never looks frozen.