: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
perf(frontend): cache product setup detection so scenes open without a probe (#106341)
Paul D'Ambrae44a950fa864
diff --git a/.agents/skills/building-product-empty-states/SKILL.md b/.agents/skills/building-product-empty-states/SKILL.mdindex 9f089a1f9632..d0634bdc415d 100644--- a/.agents/skills/building-product-empty-states/SKILL.md+++ b/.agents/skills/building-product-empty-states/SKILL.md@@ -36,7 +36,7 @@ export const logsSetupLogic = createSetupDetectionLogic({})```-`detect` composes freely: retry inside it with `retryWithBackoff`, return `unknown` for "cannot tell" (e.g. no access), return `waiting-for-data` from an opt-in flag + count check. When the query is a fresh event count, use `refresh: 'force_blocking'` - a cached pre-ingestion `[0,0]` would otherwise stick. `recheckActionTypes` re-detects immediately when app state changes elsewhere (a team-setting opt-in). `cacheHasData` remembers a has-data answer in localStorage so returning users skip the spinner and the query - use it for products with no boot-time probe.+`detect` composes freely: retry inside it with `retryWithBackoff`, return `unknown` for "cannot tell" (e.g. no access), return `waiting-for-data` from an opt-in flag + count check. When the query is a fresh event count, use `refresh: 'force_blocking'` - a cached pre-ingestion `[0,0]` would otherwise stick. `recheckActionTypes` re-detects immediately when app state changes elsewhere (a team-setting opt-in). `cacheHasData` remembers a has-data answer in localStorage so returning users skip the spinner and the query - use it for products with no boot-time probe. Add `revalidateCachedHasData` when the data can go away (entities users delete, recordings that expire, a lookback window): the cached answer still opens the gate at once, detection runs once in the background, and a `needs-setup` or `waiting-for-data` answer clears the cache so the next visit shows the empty state. It never replaces the mounted scene, so an open modal or a half-created entity survives. Plain `cacheHasData` is for ingested data that stays. Recheck actions stop re-detecting once the status is `has-data`, since their job is to flip the gate open after the first entity is created in place.Products whose detection drives more than the gate (extra selectors, staged dashboards) keep a bespoke logic instead - template: `products/mcp_analytics/frontend/mcpAnalyticsOnboardingLogic.ts`. It must push the status from a listener and handle failure the same way the factory does:diff --git a/common/storybook/.storybook/decorators/withKea/kea-story.tsx b/common/storybook/.storybook/decorators/withKea/kea-story.tsxindex 6a1ec7c0d37d..9f2ce5bebece 100644--- a/common/storybook/.storybook/decorators/withKea/kea-story.tsx+++ b/common/storybook/.storybook/decorators/withKea/kea-story.tsx@@ -3,6 +3,7 @@ import { getContext } from 'kea'import { router } from 'kea-router'import { useEffect, useState } from 'react'+import { clearAllCachedHasData } from 'lib/components/ProductEmptyState/setupDetectionLogic'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { App } from 'scenes/App'// Eagerly bring AuthenticatedShell into the storybook bundle. App.tsx code-splits@@ -42,6 +43,9 @@ function unmountLogicsOfPreviousStory(): void {export function resetKeaStory(): void {worker.resetHandlers()unmountLogicsOfPreviousStory()+ // Stories in one file share a browser context, so a has-data answer cached by one story+ // would open the gate over the next story's empty state.+ clearAllCachedHasData()const history = createMemoryHistory({});(history as any).pushState = history.pushdiff --git a/frontend/src/lib/components/ProductEmptyState/ProductEmptyStateGate.tsx b/frontend/src/lib/components/ProductEmptyState/ProductEmptyStateGate.tsxindex 4e6b41cce8c9..6311e9b1abbb 100644--- a/frontend/src/lib/components/ProductEmptyState/ProductEmptyStateGate.tsx+++ b/frontend/src/lib/components/ProductEmptyState/ProductEmptyStateGate.tsx@@ -97,8 +97,8 @@ function ProductEmptyStateGateInner({ emptyState, children }: ProductEmptyStateG// One consistent loading treatment app-wide, the same scene-level spinner shown while// scene chunks load. `productSetupPreloadLogic` answers this ahead of time only for// products that declare a `setupProbe` in their manifest, which is an event-based- // signal. Entity-count products have none, so for them the spinner is the normal path- // on every entry, including every trip back from a detail page.+ // signal. Entity-count products have none, so the spinner shows until their detection+ // answers, unless `cacheHasData` remembered a has-data answer from an earlier visit.return (<ProductSceneFrame config={config} SceneNav={emptyState.SceneNav}><SpinnerOverlay sceneLevel />diff --git a/frontend/src/lib/components/ProductEmptyState/README.md b/frontend/src/lib/components/ProductEmptyState/README.mdindex 3b21e0652d54..f780e037e374 100644--- a/frontend/src/lib/components/ProductEmptyState/README.md+++ b/frontend/src/lib/components/ProductEmptyState/README.md@@ -6,7 +6,7 @@ Scenes opt in declaratively: set `emptyState` on the scene's `SceneExport` and t`productSetupStatusLogic` (keyed by `ProductKey`) is the app-wide single read point for "is product X set up?"; each product's detection logic pushes its status into it.-Most detection logics are one call to `createSetupDetectionLogic` (`setupDetectionLogic.ts`): the product supplies a `detect` function resolving its status, and the factory owns the shared contract — detect on mount, optionally poll until data lands (stopping for good on `has-data`), and fail open on errors so a broken query never strands the gate on its spinner. Products whose detection drives more than the gate (extra selectors, staged dashboards like MCP analytics) keep a bespoke logic that pushes into `productSetupStatusLogic` directly.+Most detection logics are one call to `createSetupDetectionLogic` (`setupDetectionLogic.ts`): the product supplies a `detect` function resolving its status, and the factory owns the shared contract — detect on mount, optionally poll until data lands (stopping for good on `has-data`), and fail open on errors so a broken query never strands the gate on its spinner. With `cacheHasData`, a has-data answer is remembered per team and product, so a returning user's scene opens without waiting for the probe; `revalidateCachedHasData` adds one background check for products whose data can go away. A no-data answer clears the cache so the next visit shows the empty state, and never replaces the mounted scene. Products whose detection drives more than the gate (extra selectors, staged dashboards like MCP analytics) keep a bespoke logic that pushes into `productSetupStatusLogic` directly.Products detectable from event definitions also declare a `setupProbe` in their manifest, which `productSetupPreloadLogic` answers at app boot with one batched request — so the status is usually known before the scene is ever opened. Probes support a `staleAfterDays` window for products where old, abandoned data shouldn't count as set up.diff --git a/frontend/src/lib/components/ProductEmptyState/setupDetectionLogic.test.ts b/frontend/src/lib/components/ProductEmptyState/setupDetectionLogic.test.tsindex 934e37928a67..428039fd2e04 100644--- a/frontend/src/lib/components/ProductEmptyState/setupDetectionLogic.test.ts+++ b/frontend/src/lib/components/ProductEmptyState/setupDetectionLogic.test.ts@@ -1,9 +1,10 @@-import { MOCK_DEFAULT_TEAM } from 'lib/api.mock'+import { MOCK_DEFAULT_PROJECT, MOCK_DEFAULT_TEAM } from 'lib/api.mock'import { expectLogic } from 'kea-test-utils'import { ApiError } from 'lib/api-error'import { productSetupStatusLogic } from 'lib/components/ProductEmptyState/productSetupStatusLogic'+import { projectLogic } from 'scenes/projectLogic'import { teamLogic } from 'scenes/teamLogic'import { ProductKey } from '~/queries/schema/schema-general'@@ -14,7 +15,6 @@ import type { ProductSetupStatus } from './types'describe('createSetupDetectionLogic', () => {beforeEach(() => {- localStorage.clear()initKeaTests()})@@ -57,6 +57,22 @@ describe('createSetupDetectionLogic', () => {expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe('unknown')})+ it('detects once the project loads when mounted before it is known', async () => {+ projectLogic.actions.loadCurrentProjectSuccess(null)+ const detect = jest.fn<Promise<ProductSetupStatus | null>, []>().mockResolvedValue('needs-setup')+ const logic = buildLogic(detect)+ logic.mount()+ projectLogic.actions.loadCurrentProjectSuccess(null)+ await expectLogic(logic).toFinishAllListeners()+ expect(detect).not.toHaveBeenCalled()++ projectLogic.actions.loadCurrentProjectSuccess(MOCK_DEFAULT_PROJECT)+ projectLogic.actions.loadCurrentProjectSuccess(MOCK_DEFAULT_PROJECT)+ await expectLogic(logic).toFinishAllListeners()+ expect(detect).toHaveBeenCalledTimes(1)+ expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe('needs-setup')+ })+it.each([['rejects', 'needs-setup'],['returns null', 'needs-setup'],@@ -152,28 +168,34 @@ describe('createSetupDetectionLogic', () => {expect(detect).toHaveBeenCalledTimes(3)})- it('re-detects when a recheck action fires', async () => {- const detect = jest- .fn<Promise<ProductSetupStatus>, []>()- .mockResolvedValueOnce('needs-setup')- .mockResolvedValue('waiting-for-data')- const logic = createSetupDetectionLogic({- productKey: ProductKey.LOGS,- path: ['test', 'setupDetectionLogic'],- detect,- recheckActionTypes: () => [teamLogic.actionTypes.updateCurrentTeamSuccess],- }).build()- logic.mount()- await expectLogic(logic).toFinishAllListeners()- expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe('needs-setup')+ // Data catalog rechecked on every list load, re-running a slow probe after the gate had+ // already opened; a needs-setup scene must still flip when its first entity lands.+ it.each([+ ['needs-setup', 2, 'waiting-for-data'],+ ['has-data', 1, 'has-data'],+ ] as const)(+ 'on a recheck action while %s, runs detection %s time(s) in total',+ async (initial, calls, expected) => {+ const detect = jest+ .fn<Promise<ProductSetupStatus>, []>()+ .mockResolvedValueOnce(initial)+ .mockResolvedValue('waiting-for-data')+ const logic = createSetupDetectionLogic({+ productKey: ProductKey.LOGS,+ path: ['test', 'setupDetectionLogic'],+ detect,+ recheckActionTypes: () => [teamLogic.actionTypes.updateCurrentTeamSuccess],+ }).build()+ logic.mount()+ await expectLogic(logic).toFinishAllListeners()+ expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe(initial)- // A team-setting flip (e.g. enabling exception autocapture) must refresh- // the status right away, not on the next poll tick.- teamLogic.actions.updateCurrentTeamSuccess(MOCK_DEFAULT_TEAM, undefined)- await expectLogic(logic).toFinishAllListeners()- expect(detect).toHaveBeenCalledTimes(2)- expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe('waiting-for-data')- })+ teamLogic.actions.updateCurrentTeamSuccess(MOCK_DEFAULT_TEAM, undefined)+ await expectLogic(logic).toFinishAllListeners()+ expect(detect).toHaveBeenCalledTimes(calls)+ expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe(expected)+ }+ )it('with cacheHasData, remembers has-data and skips detection on the next mount', async () => {const onDetected = jest.fn()@@ -205,6 +227,123 @@ describe('createSetupDetectionLogic', () => {expect(onDetected).toHaveBeenCalledWith('has-data')})+ describe('with revalidateCachedHasData', () => {+ function buildCached(+ detect: jest.Mock<Promise<ProductSetupStatus | null>, []>,+ revalidateCachedHasData: boolean+ ): ReturnType<ReturnType<typeof createSetupDetectionLogic>['build']> {+ return createSetupDetectionLogic({+ productKey: ProductKey.LOGS,+ path: ['test', 'setupDetectionLogic'],+ detect,+ cacheHasData: true,+ revalidateCachedHasData,+ }).build()+ }++ async function seedCachedHasData(): Promise<void> {+ const seed = buildCached(jest.fn().mockResolvedValue('has-data'), true)+ seed.mount()+ await expectLogic(seed).toFinishAllListeners()+ seed.unmount()+ }++ async function nextMountDetects(): Promise<boolean> {+ const detect = jest.fn<Promise<ProductSetupStatus | null>, []>().mockResolvedValue('needs-setup')+ const next = buildCached(detect, false)+ next.mount()+ await expectLogic(next).toFinishAllListeners()+ next.unmount()+ return detect.mock.calls.length > 0+ }++ function mountWithPendingRevalidation(): {+ logic: ReturnType<typeof buildCached>+ answer: (status: ProductSetupStatus) => void+ } {+ let answer: (status: ProductSetupStatus) => void = () => {}+ const logic = buildCached(+ jest.fn<Promise<ProductSetupStatus | null>, []>(() => new Promise((resolve) => (answer = resolve))),+ true+ )+ logic.mount()+ return { logic, answer: (status) => answer(status) }+ }++ function switchTeam(id: number): void {+ teamLogic.actions.loadCurrentTeamSuccess({ ...MOCK_DEFAULT_TEAM, id })+ }++ it.each(['needs-setup', 'waiting-for-data'] as const)(+ 'keeps the mounted scene on has-data and drops the cache when the check answers %s',+ async (noData) => {+ await seedCachedHasData()+ const { logic, answer } = mountWithPendingRevalidation()+ expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe('has-data')++ answer(noData)+ await expectLogic(logic).toFinishAllListeners()+ expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe('has-data')+ logic.unmount()+ expect(await nextMountDetects()).toBe(true)+ }+ )++ it('clears only the original team cache when the team changes mid-check', async () => {+ const otherTeamId = MOCK_DEFAULT_TEAM.id + 1+ switchTeam(otherTeamId)+ await seedCachedHasData()+ switchTeam(MOCK_DEFAULT_TEAM.id)+ await seedCachedHasData()++ const { logic, answer } = mountWithPendingRevalidation()+ switchTeam(otherTeamId)+ answer('needs-setup')+ await expectLogic(logic).toFinishAllListeners()+ logic.unmount()++ expect(await nextMountDetects()).toBe(false)+ switchTeam(MOCK_DEFAULT_TEAM.id)+ expect(await nextMountDetects()).toBe(true)+ })++ it.each([+ ['rejects', () => Promise.reject(new Error('network down'))],+ ['returns null', () => Promise.resolve(null)],+ ['returns unknown', () => Promise.resolve('unknown' as const)],+ ])('keeps has-data and the cache when the background check %s', async (_, answer) => {+ await seedCachedHasData()+ const logic = buildCached(jest.fn<Promise<ProductSetupStatus | null>, []>(answer), true)+ logic.mount()+ await expectLogic(logic).toFinishAllListeners()+ expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe('has-data')+ logic.unmount()+ expect(await nextMountDetects()).toBe(false)+ })++ it('runs the revalidation once, and only after the project is known', async () => {+ await seedCachedHasData()+ projectLogic.actions.loadCurrentProjectSuccess(null)++ const detect = jest.fn<Promise<ProductSetupStatus | null>, []>(async () =>+ projectLogic.findMounted()?.values.currentProjectId ? 'needs-setup' : null+ )+ const logic = buildCached(detect, true)+ logic.mount()+ projectLogic.actions.loadCurrentProjectSuccess(null)+ await expectLogic(logic).toFinishAllListeners()+ expect(detect).not.toHaveBeenCalled()+ expect(productSetupStatusLogic({ productKey: ProductKey.LOGS }).values.status).toBe('has-data')++ projectLogic.actions.loadCurrentProjectSuccess(MOCK_DEFAULT_PROJECT)+ projectLogic.actions.loadCurrentProjectSuccess(MOCK_DEFAULT_PROJECT)+ await expectLogic(logic).toFinishAllListeners()+ expect(detect).toHaveBeenCalledTimes(1)+ logic.unmount()+ expect(await nextMountDetects()).toBe(true)+ })+ })+it('does not poll when no interval is configured', async () => {jest.useFakeTimers()const detect = jest.fn<Promise<ProductSetupStatus>, []>().mockResolvedValue('needs-setup')diff --git a/frontend/src/lib/components/ProductEmptyState/setupDetectionLogic.ts b/frontend/src/lib/components/ProductEmptyState/setupDetectionLogic.tsindex 70f919e5610c..130c6d233bf3 100644--- a/frontend/src/lib/components/ProductEmptyState/setupDetectionLogic.ts+++ b/frontend/src/lib/components/ProductEmptyState/setupDetectionLogic.ts@@ -1,4 +1,14 @@-import { BreakPointFunction, LogicWrapper, MakeLogicType, afterMount, connect, kea, listeners, path } from 'kea'+import {+ BreakPointFunction,+ LogicWrapper,+ MakeLogicType,+ actions,+ afterMount,+ connect,+ kea,+ listeners,+ path,+} from 'kea'import { loaders } from 'kea-loaders'import { isScopeNotFoundError } from 'lib/api-error'@@ -51,6 +61,12 @@ export interface SetupDetectionLogicOptions {* and a query on every scene entry.*/cacheHasData?: boolean+ /**+ * With `cacheHasData`, re-run detection once in the background after a cached has-data+ * answer, for data users can delete or that ages out of the probe's window. A no-data answer+ * clears the cache so the next visit shows the empty state. It never replaces the mounted scene.+ */+ revalidateCachedHasData?: boolean}export interface SetupDetectionValues {@@ -63,6 +79,7 @@ export interface SetupDetectionValues {export interface SetupDetectionActions {detectStatus: () => void+ revalidateCachedStatus: () => { value: true }detectStatusSuccess: (detectedStatus: ProductSetupStatus | null,payload?: void@@ -73,6 +90,52 @@ export interface SetupDetectionActions {export type SetupDetectionLogicType = MakeLogicType<SetupDetectionValues, SetupDetectionActions>+const HAS_DATA_CACHE_PREFIX = 'ph-product-setup-has-data/'++function hasDataCacheKey(teamId: number, productKey: ProductKey): string {+ return `${HAS_DATA_CACHE_PREFIX}${teamId}/${productKey}`+}++// localStorage throws in private modes or when disabled; a miss only costs a re-detect.+function tryStorage<T>(fallback: T, run: (storage: Storage) => T): T {+ try {+ return run(window.localStorage)+ } catch {+ return fallback+ }+}++/** Drops every product's cached has-data answer, so isolated renders (stories, tests) detect afresh. */+export function clearAllCachedHasData(): void {+ tryStorage(undefined, (storage) =>+ Object.keys(storage)+ .filter((key) => key.startsWith(HAS_DATA_CACHE_PREFIX))+ .forEach((key) => storage.removeItem(key))+ )+}++function readCachedHasData(teamId: number | null, productKey: ProductKey): boolean {+ return (+ teamId !== null && tryStorage(false, (storage) => storage.getItem(hasDataCacheKey(teamId, productKey)) === '1')+ )+}++function writeCachedHasData(teamId: number | null, productKey: ProductKey): void {+ if (teamId !== null) {+ tryStorage(undefined, (storage) => storage.setItem(hasDataCacheKey(teamId, productKey), '1'))+ }+}++function clearCachedHasData(teamId: number | null, productKey: ProductKey): void {+ if (teamId !== null) {+ tryStorage(undefined, (storage) => storage.removeItem(hasDataCacheKey(teamId, productKey)))+ }+}++function isNoDataStatus(status: ProductSetupStatus | null): status is 'needs-setup' | 'waiting-for-data' {+ return status === 'needs-setup' || status === 'waiting-for-data'+}+/*** Builds a product's empty-state detection logic: the piece that answers "is this* product set up?" and pushes the answer into `productSetupStatusLogic`. Wraps the@@ -91,31 +154,16 @@ export type SetupDetectionLogicType = MakeLogicType<SetupDetectionValues, SetupD* Products whose detection drives more than the gate (extra selectors, multi-stage* dashboards like MCP analytics) keep a bespoke logic instead.*/-function hasDataCacheKey(teamId: number, productKey: ProductKey): string {- return `ph-product-setup-has-data/${teamId}/${productKey}`-}--// localStorage can throw (private modes, disabled storage); a cache miss is always safe.-function readCachedHasData(teamId: number | null, productKey: ProductKey): boolean {- try {- return teamId !== null && window.localStorage.getItem(hasDataCacheKey(teamId, productKey)) === '1'- } catch {- return false- }-}--function writeCachedHasData(teamId: number | null, productKey: ProductKey): void {- try {- if (teamId !== null) {- window.localStorage.setItem(hasDataCacheKey(teamId, productKey), '1')- }- } catch {- // Nothing cached; the next mount just detects again.- }-}-export function createSetupDetectionLogic(options: SetupDetectionLogicOptions): LogicWrapper<SetupDetectionLogicType> {- const { productKey, detect, pollIntervalMs, onDetected, recheckActionTypes, cacheHasData } = options+ const {+ productKey,+ detect,+ pollIntervalMs,+ onDetected,+ recheckActionTypes,+ cacheHasData,+ revalidateCachedHasData,+ } = optionsreturn buildKea<SetupDetectionLogicType>([path(options.path),connect(() => ({@@ -129,6 +177,7 @@ export function createSetupDetectionLogic(options: SetupDetectionLogicOptions):['currentTeamId'],],})),+ actions({ revalidateCachedStatus: true }),loaders({detectedStatus: {__default: null as ProductSetupStatus | null,@@ -144,12 +193,19 @@ export function createSetupDetectionLogic(options: SetupDetectionLogicOptions):(recheckActionTypes?.() ?? []).map((actionType) => [actionType,() => {- if (values.currentProjectId) {+ if (values.currentProjectId && values.setupStatus !== 'has-data') {actions.detectStatus()}},])),+ revalidateCachedStatus: async () => {+ const teamId = values.currentTeamId+ const status = await detectOrNull(detect)+ if (isNoDataStatus(status)) {+ clearCachedHasData(teamId, productKey)+ }+ },detectStatusSuccess: ({ detectedStatus }) => {if (!detectedStatus) {if (values.setupStatus === 'loading') {@@ -182,9 +238,10 @@ export function createSetupDetectionLogic(options: SetupDetectionLogicOptions):}},[projectLogic.actionTypes.loadCurrentProjectSuccess]: () => {- // Covers non-polling products mounted before bootstrap settled.- if (values.detectedStatus === null && !values.detectedStatusLoading) {- actions.detectStatus()+ const run = cache.runWhenProjectKnown+ if (run && values.currentProjectId) {+ cache.runWhenProjectKnown = null+ run()}},})),@@ -194,22 +251,51 @@ export function createSetupDetectionLogic(options: SetupDetectionLogicOptions):// The cache skips detection, not the side effects - returning users take// this path on every later visit.onDetected?.('has-data')+ if (revalidateCachedHasData) {+ runOnceProjectIsKnown(cache, values, actions.revalidateCachedStatus)+ }return}- // The API layer resolves the project from bootstrap state, so a check fired- // before that settles throws instead of answering - skip those ticks.- const detectIfProjectKnown = (): void => {+ runOnceProjectIsKnown(cache, values, actions.detectStatus)+ startPoll(cache, actions, values, pollIntervalMs)+ }),+ ])+}++async function detectOrNull(detect: () => Promise<ProductSetupStatus | null>): Promise<ProductSetupStatus | null> {+ try {+ return await detect()+ } catch {+ return null+ }+}++function runOnceProjectIsKnown(+ cache: Record<string, any>,+ values: Pick<SetupDetectionValues, 'currentProjectId'>,+ run: () => void+): void {+ if (values.currentProjectId) {+ run()+ } else {+ cache.runWhenProjectKnown = run+ }+}++function startPoll(+ cache: Record<string, any>,+ actions: Pick<SetupDetectionLogicType['actions'], 'detectStatus'>,+ values: Pick<SetupDetectionValues, 'currentProjectId'>,+ pollIntervalMs: number | undefined+): void {+ if (pollIntervalMs) {+ cache.disposables.add(() => {+ const id = window.setInterval(() => {if (values.currentProjectId) {actions.detectStatus()}- }- detectIfProjectKnown()- if (pollIntervalMs) {- cache.disposables.add(() => {- const id = window.setInterval(detectIfProjectKnown, pollIntervalMs)- return () => clearInterval(id)- }, 'poll')- }- }),- ])+ }, pollIntervalMs)+ return () => clearInterval(id)+ }, 'poll')+ }}diff --git a/frontend/src/test/init.ts b/frontend/src/test/init.tsindex 0e28d02673ae..95454ad3d427 100644--- a/frontend/src/test/init.ts+++ b/frontend/src/test/init.ts@@ -4,6 +4,7 @@ import { createMemoryHistory } from 'history'import { testUtilsPlugin } from 'kea-test-utils'import posthog from 'posthog-js'+import { clearAllCachedHasData } from 'lib/components/ProductEmptyState/setupDetectionLogic'import { dayjs } from 'lib/dayjs'import { organizationLogic } from 'scenes/organizationLogic'import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'@@ -24,6 +25,7 @@ export function initKeaTests(organizationForWindowContext?: OrganizationType): void {dayjs.tz.setDefault('UTC')+ clearAllCachedHasData()const existingAppContext = window.POSTHOG_APP_CONTEXTconst orgToUse = organizationForWindowContext ?? MOCK_DEFAULT_ORGANIZATIONwindow.POSTHOG_APP_CONTEXT = {diff --git a/products/actions/frontend/emptyState/actionsSetupLogic.ts b/products/actions/frontend/emptyState/actionsSetupLogic.tsindex ea770681abd1..9284f6f197b3 100644--- a/products/actions/frontend/emptyState/actionsSetupLogic.ts+++ b/products/actions/frontend/emptyState/actionsSetupLogic.ts@@ -13,6 +13,8 @@ import { actionsList } from '../generated/api'export const actionsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.ACTIONS,path: ['products', 'actions', 'frontend', 'emptyState', 'actionsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await actionsList(projectId, { limit: 1 })diff --git a/products/ai_observability/frontend/emptyState/clustersSetupLogic.ts b/products/ai_observability/frontend/emptyState/clustersSetupLogic.tsindex 9b083861f26e..0ae3e10c253a 100644--- a/products/ai_observability/frontend/emptyState/clustersSetupLogic.ts+++ b/products/ai_observability/frontend/emptyState/clustersSetupLogic.ts@@ -18,6 +18,8 @@ const CLUSTERING_RUN_EVENTS = ['$ai_trace_clusters', '$ai_generation_clusters',export const clustersSetupLogic = createSetupDetectionLogic({productKey: ProductKey.LLM_CLUSTERS,path: ['products', 'ai_observability', 'frontend', 'emptyState', 'clustersSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const response = await api.queryHogQL(hogql`SELECT 1 FROM events WHERE event IN ${CLUSTERING_RUN_EVENTS} AND timestamp >= now() - INTERVAL ${hogql.raw(String(CLUSTERING_RUNS_LOOKBACK_DAYS))} DAY LIMIT 1`,diff --git a/products/ai_observability/frontend/emptyState/datasetsSetupLogic.ts b/products/ai_observability/frontend/emptyState/datasetsSetupLogic.tsindex 7817f624ff2c..364bb71b5d89 100644--- a/products/ai_observability/frontend/emptyState/datasetsSetupLogic.ts+++ b/products/ai_observability/frontend/emptyState/datasetsSetupLogic.ts@@ -12,6 +12,8 @@ import { datasetsList } from '../generated/api'export const datasetsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.LLM_DATASETS,path: ['products', 'ai_observability', 'frontend', 'emptyState', 'datasetsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await datasetsList(projectId, { limit: 1 })diff --git a/products/ai_observability/frontend/emptyState/evaluationsSetupLogic.ts b/products/ai_observability/frontend/emptyState/evaluationsSetupLogic.tsindex c131d8fa9805..a84942727967 100644--- a/products/ai_observability/frontend/emptyState/evaluationsSetupLogic.ts+++ b/products/ai_observability/frontend/emptyState/evaluationsSetupLogic.ts@@ -13,6 +13,8 @@ import { evaluationDirectoriesList, evaluationsList } from '../generated/api'export const evaluationsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.LLM_EVALUATIONS,path: ['products', 'ai_observability', 'frontend', 'emptyState', 'evaluationsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const [evaluations, directories] = await Promise.all([diff --git a/products/alerts/frontend/emptyState/alertsSetupLogic.ts b/products/alerts/frontend/emptyState/alertsSetupLogic.tsindex 56ee8d2c8bc2..0f76721f3324 100644--- a/products/alerts/frontend/emptyState/alertsSetupLogic.ts+++ b/products/alerts/frontend/emptyState/alertsSetupLogic.ts@@ -18,6 +18,8 @@ import { hasEffectiveResourceAccess } from '../utils'export const alertsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.ALERTS,path: ['products', 'alerts', 'frontend', 'emptyState', 'alertsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const canViewInsightAlerts = hasEffectiveResourceAccess(AccessControlResourceType.Insight)const canViewLogAlerts = hasEffectiveResourceAccess(AccessControlResourceType.Logs)diff --git a/products/annotations/frontend/emptyState/annotationsSetupLogic.ts b/products/annotations/frontend/emptyState/annotationsSetupLogic.tsindex ba311b2c5220..446ec3eeed61 100644--- a/products/annotations/frontend/emptyState/annotationsSetupLogic.ts+++ b/products/annotations/frontend/emptyState/annotationsSetupLogic.ts@@ -14,6 +14,8 @@ import { annotationsList } from '../generated/api'export const annotationsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.ANNOTATIONS,path: ['products', 'annotations', 'frontend', 'emptyState', 'annotationsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await annotationsList(projectId, { limit: 1 })diff --git a/products/business_knowledge/frontend/emptyState/businessKnowledgeSetupLogic.ts b/products/business_knowledge/frontend/emptyState/businessKnowledgeSetupLogic.tsindex 807532227f1a..e1903514bec4 100644--- a/products/business_knowledge/frontend/emptyState/businessKnowledgeSetupLogic.ts+++ b/products/business_knowledge/frontend/emptyState/businessKnowledgeSetupLogic.ts@@ -14,6 +14,8 @@ import { businessKnowledgeLogic } from '../scenes/businessKnowledgeLogic'export const businessKnowledgeSetupLogic = createSetupDetectionLogic({productKey: ProductKey.BUSINESS_KNOWLEDGE,path: ['products', 'business_knowledge', 'frontend', 'emptyState', 'businessKnowledgeSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await businessKnowledgeSourcesList(projectId, { limit: 1 })diff --git a/products/cdp/frontend/emptyState/destinationsSetupLogic.ts b/products/cdp/frontend/emptyState/destinationsSetupLogic.tsindex b417a187ddef..247579692303 100644--- a/products/cdp/frontend/emptyState/destinationsSetupLogic.ts+++ b/products/cdp/frontend/emptyState/destinationsSetupLogic.ts@@ -16,6 +16,8 @@ import { hogFunctionsList } from '../generated/api'export const destinationsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.PIPELINE_DESTINATIONS,path: ['products', 'cdp', 'frontend', 'emptyState', 'destinationsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const [hogFunctions, pluginDestinations, batchExports] = await Promise.all([diff --git a/products/cdp/frontend/emptyState/transformationsSetupLogic.ts b/products/cdp/frontend/emptyState/transformationsSetupLogic.tsindex e6afbf837676..4c73b12c1018 100644--- a/products/cdp/frontend/emptyState/transformationsSetupLogic.ts+++ b/products/cdp/frontend/emptyState/transformationsSetupLogic.ts@@ -14,6 +14,8 @@ import { hogFunctionsList } from '../generated/api'export const transformationsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.PIPELINE_TRANSFORMATIONS,path: ['products', 'cdp', 'frontend', 'emptyState', 'transformationsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await hogFunctionsList(projectId, { type: ['transformation'], limit: 1 })diff --git a/products/cohorts/frontend/emptyState/cohortsSetupLogic.ts b/products/cohorts/frontend/emptyState/cohortsSetupLogic.tsindex 2e9cfcdebe95..e4254653e4da 100644--- a/products/cohorts/frontend/emptyState/cohortsSetupLogic.ts+++ b/products/cohorts/frontend/emptyState/cohortsSetupLogic.ts@@ -13,6 +13,8 @@ import { cohortsList } from '../generated/api'export const cohortsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.COHORTS,path: ['products', 'cohorts', 'frontend', 'emptyState', 'cohortsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await cohortsList(projectId, { limit: 1 })diff --git a/products/dashboards/frontend/emptyState/dashboardsSetupLogic.ts b/products/dashboards/frontend/emptyState/dashboardsSetupLogic.tsindex 2953ce15dec8..54f935f8637c 100644--- a/products/dashboards/frontend/emptyState/dashboardsSetupLogic.ts+++ b/products/dashboards/frontend/emptyState/dashboardsSetupLogic.ts@@ -23,4 +23,6 @@ export const dashboardsSetupLogic = createSetupDetectionLogic({// creation" field defaults to off, so the usual path leaves the user on this scene// with no remount to re-run detection.recheckActionTypes: () => [dashboardsModel.actionTypes.addDashboardSuccess],+ cacheHasData: true,+ revalidateCachedHasData: true,})diff --git a/products/data_catalog/frontend/emptyState/dataCatalogSetupLogic.ts b/products/data_catalog/frontend/emptyState/dataCatalogSetupLogic.tsindex 0459f39bc385..a46afc8e536a 100644--- a/products/data_catalog/frontend/emptyState/dataCatalogSetupLogic.ts+++ b/products/data_catalog/frontend/emptyState/dataCatalogSetupLogic.ts@@ -14,6 +14,8 @@ import { metricsLogic } from '../metricsLogic'export const dataCatalogSetupLogic = createSetupDetectionLogic({productKey: ProductKey.DATA_CATALOG,path: ['products', 'data_catalog', 'frontend', 'emptyState', 'dataCatalogSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await dataCatalogMetricsList(projectId, { limit: 1 })diff --git a/products/data_warehouse/frontend/emptyState/dataWarehouseSetupLogic.ts b/products/data_warehouse/frontend/emptyState/dataWarehouseSetupLogic.tsindex bd4a9c817608..ec5cf3ee4606 100644--- a/products/data_warehouse/frontend/emptyState/dataWarehouseSetupLogic.ts+++ b/products/data_warehouse/frontend/emptyState/dataWarehouseSetupLogic.ts@@ -11,6 +11,8 @@ import { ProductKey } from '~/queries/schema/schema-general'export const dataWarehouseSetupLogic = createSetupDetectionLogic({productKey: ProductKey.DATA_WAREHOUSE,path: ['products', 'data_warehouse', 'frontend', 'emptyState', 'dataWarehouseSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const [sources, tables] = await Promise.all([api.externalDataSources.list(),diff --git a/products/engineering_analytics/frontend/emptyState/engineeringAnalyticsSetupLogic.ts b/products/engineering_analytics/frontend/emptyState/engineeringAnalyticsSetupLogic.tsindex aca5f7ef9472..c046288866b9 100644--- a/products/engineering_analytics/frontend/emptyState/engineeringAnalyticsSetupLogic.ts+++ b/products/engineering_analytics/frontend/emptyState/engineeringAnalyticsSetupLogic.ts@@ -13,6 +13,8 @@ import { engineeringAnalyticsSources } from '../generated/api'export const engineeringAnalyticsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.ENGINEERING_ANALYTICS,path: ['products', 'engineering_analytics', 'frontend', 'emptyState', 'engineeringAnalyticsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const sources = await engineeringAnalyticsSources(projectId)diff --git a/products/error_tracking/frontend/emptyState/errorTrackingSetupLogic.ts b/products/error_tracking/frontend/emptyState/errorTrackingSetupLogic.tsindex 1211d45522d1..378c40e4bb3a 100644--- a/products/error_tracking/frontend/emptyState/errorTrackingSetupLogic.ts+++ b/products/error_tracking/frontend/emptyState/errorTrackingSetupLogic.ts@@ -13,6 +13,7 @@ import { ProductKey } from '~/queries/schema/schema-general'export const errorTrackingSetupLogic = createSetupDetectionLogic({productKey: ProductKey.ERROR_TRACKING,path: ['products', 'error_tracking', 'frontend', 'emptyState', 'errorTrackingSetupLogic'],+ cacheHasData: true,detect: async () => {const response = await new ApiRequest().errorTrackingIssuesExists().get()if (response?.exists === true) {diff --git a/products/metrics/frontend/emptyState/metricsSetupLogic.test.ts b/products/metrics/frontend/emptyState/metricsSetupLogic.test.tsindex 4a35547d4164..ee40bee86c2b 100644--- a/products/metrics/frontend/emptyState/metricsSetupLogic.test.ts+++ b/products/metrics/frontend/emptyState/metricsSetupLogic.test.ts@@ -19,7 +19,6 @@ jest.mock('lib/utils/async', () => ({describe('metricsSetupLogic', () => {beforeEach(() => {- localStorage.clear()initKeaTests()})diff --git a/products/notebooks/frontend/emptyState/notebooksSetupLogic.ts b/products/notebooks/frontend/emptyState/notebooksSetupLogic.tsindex 0392059fe977..7631f1e7eee1 100644--- a/products/notebooks/frontend/emptyState/notebooksSetupLogic.ts+++ b/products/notebooks/frontend/emptyState/notebooksSetupLogic.ts@@ -13,6 +13,8 @@ import { notebooksList } from '../generated/api'export const notebooksSetupLogic = createSetupDetectionLogic({productKey: ProductKey.NOTEBOOKS,path: ['products', 'notebooks', 'frontend', 'emptyState', 'notebooksSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await notebooksList(projectId, { limit: 1 })diff --git a/products/product_analytics/frontend/emptyState/productAnalyticsSetupLogic.ts b/products/product_analytics/frontend/emptyState/productAnalyticsSetupLogic.tsindex 0d3230b89f48..f94f93418823 100644--- a/products/product_analytics/frontend/emptyState/productAnalyticsSetupLogic.ts+++ b/products/product_analytics/frontend/emptyState/productAnalyticsSetupLogic.ts@@ -13,6 +13,8 @@ import { insightsList } from '../generated/api'export const productAnalyticsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.PRODUCT_ANALYTICS,path: ['products', 'product_analytics', 'frontend', 'emptyState', 'productAnalyticsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await insightsList(projectId, { limit: 1 })diff --git a/products/pulse/frontend/emptyState/pulseSetupLogic.ts b/products/pulse/frontend/emptyState/pulseSetupLogic.tsindex c9490e0899c2..26c9d74c4beb 100644--- a/products/pulse/frontend/emptyState/pulseSetupLogic.ts+++ b/products/pulse/frontend/emptyState/pulseSetupLogic.ts@@ -14,6 +14,8 @@ import { pulseLogic } from '../pulseLogic'export const pulseSetupLogic = createSetupDetectionLogic({productKey: ProductKey.PULSE,path: ['products', 'pulse', 'frontend', 'emptyState', 'pulseSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await pulseBriefsList(projectId, { limit: 1 })diff --git a/products/replay/frontend/emptyState/sessionReplaySetupLogic.ts b/products/replay/frontend/emptyState/sessionReplaySetupLogic.tsindex b2c86af813b8..5cf0bc74f1ee 100644--- a/products/replay/frontend/emptyState/sessionReplaySetupLogic.ts+++ b/products/replay/frontend/emptyState/sessionReplaySetupLogic.ts@@ -18,12 +18,14 @@ function probeDateFrom(period: SessionRecordingRetentionPeriod | null | undefine/*** Setup detection for the session replay empty state. Three-state: recordings* exist → has-data; recording opt-in without recordings yet → waiting-for-data;- * neither → needs-setup. No has-data cache: recordings expire with retention,- * so a positive answer is not permanent.+ * neither → needs-setup. Recordings expire with retention, so a cached has-data+ * answer is revalidated in the background instead of trusted forever.*/export const sessionReplaySetupLogic = createSetupDetectionLogic({productKey: ProductKey.SESSION_REPLAY,path: ['products', 'replay', 'frontend', 'emptyState', 'sessionReplaySetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const currentTeam = teamLogic.findMounted()?.values.currentTeamconst response = await api.recordings.list({diff --git a/products/subscriptions/frontend/emptyState/subscriptionsSetupLogic.ts b/products/subscriptions/frontend/emptyState/subscriptionsSetupLogic.tsindex 211c81c85a4e..a2ac9df10695 100644--- a/products/subscriptions/frontend/emptyState/subscriptionsSetupLogic.ts+++ b/products/subscriptions/frontend/emptyState/subscriptionsSetupLogic.ts@@ -13,6 +13,8 @@ import { subscriptionsSceneLogic } from '../scenes/subscriptionsSceneLogic'export const subscriptionsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.SUBSCRIPTIONS,path: ['products', 'subscriptions', 'frontend', 'emptyState', 'subscriptionsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {// limit=1 keeps the payload tiny; `count` reflects the full team total.const response = await subscriptionsList(String(getCurrentTeamId()), { limit: 1 })diff --git a/products/surveys/frontend/emptyState/surveysSetupLogic.ts b/products/surveys/frontend/emptyState/surveysSetupLogic.tsindex e10ae8c1bc0e..8989dba9e632 100644--- a/products/surveys/frontend/emptyState/surveysSetupLogic.ts+++ b/products/surveys/frontend/emptyState/surveysSetupLogic.ts@@ -13,6 +13,8 @@ import { surveysList } from '../generated/api'export const surveysSetupLogic = createSetupDetectionLogic({productKey: ProductKey.SURVEYS,path: ['products', 'surveys', 'frontend', 'emptyState', 'surveysSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)// The list excludes archived surveys unless asked for them, and no value ofdiff --git a/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.test.ts b/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.test.tsindex 0c8723e87a0a..ee8a5e4b0414 100644--- a/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.test.ts+++ b/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.test.ts@@ -32,4 +32,18 @@ describe('webVitalsSetupLogic', () => {await expectLogic(webVitalsSetupLogic).toFinishAllListeners()expect(productSetupStatusLogic({ productKey: ProductKey.WEB_ANALYTICS }).values.status).toBe(expected)})++ it('revalidates a cached has-data answer, since users can delete the $web_vitals definition', async () => {+ initKeaTests(true, { ...MOCK_DEFAULT_TEAM, autocapture_web_vitals_opt_in: false } as TeamType)+ ;(eventDefinitionsList as jest.Mock).mockResolvedValue({ results: [{ name: '$web_vitals' }] })+ webVitalsSetupLogic.mount()+ await expectLogic(webVitalsSetupLogic).toFinishAllListeners()+ webVitalsSetupLogic.unmount()++ ;(eventDefinitionsList as jest.Mock).mockClear()+ webVitalsSetupLogic.mount()+ expect(productSetupStatusLogic({ productKey: ProductKey.WEB_ANALYTICS }).values.status).toBe('has-data')+ await expectLogic(webVitalsSetupLogic).toFinishAllListeners()+ expect(eventDefinitionsList).toHaveBeenCalled()+ })})diff --git a/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.ts b/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.tsindex 998c5ce69d99..0eb3e36ba9f3 100644--- a/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.ts+++ b/products/web_analytics/frontend/emptyState/webVitalsSetupLogic.ts@@ -14,6 +14,8 @@ import { eventDefinitionsList } from 'products/event_definitions/frontend/generaexport const webVitalsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.WEB_ANALYTICS,path: ['products', 'web_analytics', 'frontend', 'emptyState', 'webVitalsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const teamId = teamLogic.findMounted()?.values.currentTeamIdif (!teamId) {diff --git a/products/web_analytics/frontend/heatmaps/emptyState/heatmapsSetupLogic.ts b/products/web_analytics/frontend/heatmaps/emptyState/heatmapsSetupLogic.tsindex e450e5887605..8735053d2408 100644--- a/products/web_analytics/frontend/heatmaps/emptyState/heatmapsSetupLogic.ts+++ b/products/web_analytics/frontend/heatmaps/emptyState/heatmapsSetupLogic.ts@@ -12,6 +12,8 @@ import { ProductKey } from '~/queries/schema/schema-general'export const heatmapsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.HEATMAPS,path: ['products', 'web_analytics', 'frontend', 'heatmaps', 'emptyState', 'heatmapsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const response = await api.savedHeatmaps.list({ limit: 1 })return response.count > 0 ? 'has-data' : 'needs-setup'diff --git a/products/workflows/frontend/emptyState/workflowsSetupLogic.ts b/products/workflows/frontend/emptyState/workflowsSetupLogic.tsindex c8989c049974..fbc9c9ade93b 100644--- a/products/workflows/frontend/emptyState/workflowsSetupLogic.ts+++ b/products/workflows/frontend/emptyState/workflowsSetupLogic.ts@@ -12,6 +12,8 @@ import { hogFlowsList } from '../generated/api'export const workflowsSetupLogic = createSetupDetectionLogic({productKey: ProductKey.WORKFLOWS,path: ['products', 'workflows', 'frontend', 'emptyState', 'workflowsSetupLogic'],+ cacheHasData: true,+ revalidateCachedHasData: true,detect: async () => {const projectId = String(projectLogic.findMounted()?.values.currentProjectId)const response = await hogFlowsList(projectId, { limit: 1 })