: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
fix(persons): key the events tab query per person, not globally (#76052)
posthog[bot]e6bed108879f
diff --git a/frontend/src/queries/nodes/DataTable/DataTable.tsx b/frontend/src/queries/nodes/DataTable/DataTable.tsxindex 82412e21986b..4a021dadda9b 100644--- a/frontend/src/queries/nodes/DataTable/DataTable.tsx+++ b/frontend/src/queries/nodes/DataTable/DataTable.tsx@@ -1064,6 +1064,7 @@ export function DataTable({detail={context?.emptyStateDetail}icon={context?.emptyStateIcon}sampleDataVariant="table"+ insightProps={insightProps}/>)}diff --git a/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx b/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsxindex 377fbcd209cb..2e32b5e986ce 100644--- a/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx+++ b/frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx@@ -73,6 +73,7 @@ export function InsightEmptyState({detail,icon: iconProp,sampleDataVariant,+ insightProps,}: {heading?: stringdetail?: string | JSX.Element@@ -83,6 +84,7 @@ export function InsightEmptyState({* `null` to opt this call site out entirely.*/sampleDataVariant?: SampleDataVariant | null+ insightProps?: Pick<InsightLogicProps, 'dashboardId' | 'dashboardItemId'>}): JSX.Element {const { shouldShowSampleData } = useValues(sampleDataStateLogic)@@ -91,7 +93,23 @@ export function InsightEmptyState({// hover how to get real data. Call sites with purposeful custom copy keep their empty state// unless they explicitly opted in with a variant.const hasCustomCopy = heading !== undefined || detail !== undefined- if (shouldShowSampleData && sampleDataVariant !== null && (sampleDataVariant !== undefined || !hasCustomCopy)) {+ const showingSampleData =+ shouldShowSampleData && sampleDataVariant !== null && (sampleDataVariant !== undefined || !hasCustomCopy)++ // This empty state used to fire no telemetry at all, so a broken query and a genuinely empty+ // result were indistinguishable. Capture it so both are measurable.+ useOnMountEffect(() => {+ if (showingSampleData) {+ return+ }+ posthog.capture('insight empty state shown', {+ has_custom_copy: hasCustomCopy,+ dashboard_id: insightProps?.dashboardId ?? null,+ insight_short_id: typeof insightProps?.dashboardItemId === 'string' ? insightProps.dashboardItemId : null,+ })+ })++ if (showingSampleData) {return <SampleDataState variant={sampleDataVariant ?? 'line'} />}diff --git a/frontend/src/scenes/persons/PersonScene.tsx b/frontend/src/scenes/persons/PersonScene.tsxindex 377dd021b011..1b3c11d5b3c9 100644--- a/frontend/src/scenes/persons/PersonScene.tsx+++ b/frontend/src/scenes/persons/PersonScene.tsx@@ -357,9 +357,12 @@ export function PersonScene(): JSX.Element | null {setQuery={(q) => setEventsQuery(q)}context={{insightProps: {- dashboardItemId: `new-${PERSON_EVENTS_CONTEXT_KEY}`,+ dashboardItemId: `new-${eventsQueryLogicKey}`,dataNodeCollectionId: eventsQueryLogicKey,},+ emptyStateDetail: eventsQueryIsDirty+ ? 'Try changing the date range, or pick another action, event or breakdown.'+ : 'This only shows events from the last 24 hours by default. Try widening the date range, or pick another action, event or breakdown.',customActions: (<LemonButtonkey="reset-events-filters"