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(data-warehouse): stop sync history link pushing a stale tab (#62483)

Marcus Hof24a1559ff840
diff --git a/products/data_warehouse/frontend/scenes/SourceScene/SourceScene.tsx b/products/data_warehouse/frontend/scenes/SourceScene/SourceScene.tsx
index b6fc79059055..08d85b14ecd2 100644
--- a/products/data_warehouse/frontend/scenes/SourceScene/SourceScene.tsx
+++ b/products/data_warehouse/frontend/scenes/SourceScene/SourceScene.tsx
@@ -224,6 +224,13 @@ function ManagedSourceTabs({
const showMetricsTab = !!featureFlags[FEATURE_FLAGS.DWH_SOURCE_METRICS]
useEffect(() => {
+ // Wait until the source has loaded before deciding a tab is unavailable.
+ // While `source` is null, showSyncsTab/showWebhookTab are false, so a tab
+ // selected via URL (e.g. "syncs") would get bounced to "schemas" and push
+ // a bogus history entry over the URL the user actually navigated to.
+ if (!source) {
+ return
+ }
if (!showSyncsTab && currentTab === 'syncs') {
setCurrentTab('schemas')
}
@@ -233,7 +240,7 @@ function ManagedSourceTabs({
if (!showMetricsTab && currentTab === 'metrics') {
setCurrentTab('schemas')
}
- }, [showSyncsTab, showWebhookTab, showMetricsTab, currentTab, setCurrentTab])
+ }, [source, showSyncsTab, showWebhookTab, showMetricsTab, currentTab, setCurrentTab])
if (sourceLoading && !source) {
return <LemonSkeleton className="w-full h-12" />