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(eng-analytics): drop tab-aware scene logic that 404'd the scene (#65563)

Raúl Negrón-Otero12df679fe0c5
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsScene.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsScene.tsx
index 459919a492c2..f3beb67a1e6a 100644
--- a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsScene.tsx
@@ -3,7 +3,6 @@ import { combineUrl, router } from 'kea-router'
import { LemonBanner, LemonButton, LemonSelect, LemonTab, LemonTabs } from '@posthog/lemon-ui'
-import { useAttachedLogic } from 'lib/logic/scenes/useAttachedLogic'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
@@ -24,12 +23,10 @@ export const scene: SceneExport = {
logic: engineeringAnalyticsSceneLogic,
}
-export function EngineeringAnalyticsScene({ tabId }: { tabId?: string }): JSX.Element {
+export function EngineeringAnalyticsScene(): JSX.Element {
const { searchParams } = useValues(router)
const { activeTab } = useValues(engineeringAnalyticsSceneLogic)
- const logic = engineeringAnalyticsLogic({ tabId })
- // Keep this tab's filters and data alive across tab switches (React unmounts inactive tabs).
- useAttachedLogic(logic, tabId ? engineeringAnalyticsSceneLogic({ tabId }) : undefined)
+ const logic = engineeringAnalyticsLogic()
const { anyLoading, hasMultipleSources, sourceOptions, sourceId } = useValues(logic)
const { refresh, setSourceId } = useActions(logic)
@@ -51,7 +48,7 @@ export function EngineeringAnalyticsScene({ tabId }: { tabId?: string }): JSX.El
]
return (
- <BindLogic logic={engineeringAnalyticsLogic} props={{ tabId }}>
+ <BindLogic logic={engineeringAnalyticsLogic} props={{}}>
<SceneContent>
<SceneTitleSection
name="CI analytics"
diff --git a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.test.ts b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.test.ts
index 2f88f87cc7d2..0af6dcbcc791 100644
--- a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.test.ts
+++ b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsLogic.test.ts
@@ -26,6 +26,7 @@ import {
filterPullRequests,
workflowTrendSeries,
} from './engineeringAnalyticsLogic'
+import { engineeringAnalyticsSceneLogic } from './engineeringAnalyticsSceneLogic'
import { sortRunsForTriage } from './pullRequestDetailLogic'
jest.mock('../generated/api', () => ({
@@ -226,6 +227,13 @@ describe('engineeringAnalyticsLogic', () => {
expect(tabB.values.stateFilter).toBe(DEFAULT_FILTERS.state)
})
+ it('scene logic mounts without a tabId so /engineering-analytics resolves instead of 404ing', () => {
+ // #62051 collapsed sceneLogic to single-scene state and stopped threading a tabId into
+ // scene logics. A tab-aware scene logic then throws "must have a tabId prop" on mount,
+ // sceneLogic's catch falls back to Error404, and every visit to the scene 404s.
+ expect(() => engineeringAnalyticsSceneLogic().mount()).not.toThrow()
+ })
+
it('maps the three endpoints into typed rows and defaults to the open filter', async () => {
logic = engineeringAnalyticsLogic()
logic.mount()
diff --git a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsSceneLogic.ts b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsSceneLogic.ts
index 8ab9aaad5641..d76c9f252605 100644
--- a/products/engineering_analytics/frontend/scenes/engineeringAnalyticsSceneLogic.ts
+++ b/products/engineering_analytics/frontend/scenes/engineeringAnalyticsSceneLogic.ts
@@ -1,7 +1,5 @@
import { connect, kea, path, selectors } from 'kea'
-import { tabAwareScene } from 'lib/logic/scenes/tabAwareScene'
-
import { sceneLogic } from '~/scenes/sceneLogic'
import type { engineeringAnalyticsSceneLogicType } from './engineeringAnalyticsSceneLogicType'
@@ -20,7 +18,6 @@ const SCENE_KEY_TO_TAB: Record<string, EngineeringAnalyticsTab> = {
export const engineeringAnalyticsSceneLogic = kea<engineeringAnalyticsSceneLogicType>([
path(['products', 'engineering_analytics', 'frontend', 'scenes', 'engineeringAnalyticsSceneLogic']),
- tabAwareScene(),
connect(() => ({
values: [sceneLogic, ['sceneKey']],
})),