: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(data-warehouse): explain why select all skips default-off tables (#127086)
Tom Owers7438334bf455
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic.tsx b/products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic.tsxindex 4bc9f17409f8..db244b4ced48 100644--- a/products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic.tsx+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic.tsx@@ -2677,10 +2677,28 @@ export const sourceWizardLogic = kea<sourceWizardLogicType>([})}},- toggleAllTables: () => {+ toggleAllTables: ({ selectAll, tableNames }) => {// databaseSchema reducer already applied the toggle; re-emit so the// setDatabaseSchemas listener (syncExpandedSchemaGroupKeys) fires.actions.setDatabaseSchemas(values.databaseSchema)++ if (selectAll) {+ // Select all leaves default-off tables off, so the header checkbox never fills.+ // Say why, otherwise it reads as a checkbox that ignores clicks.+ const targetSet = tableNames ? new Set(tableNames) : null+ const skippedDefaultOff = values.databaseSchema.some(+ (schema) =>+ (!targetSet || targetSet.has(schema.table)) &&+ schema.should_sync_default === false &&+ !schema.should_sync &&+ !schema.permission_error+ )+ if (skippedDefaultOff) {+ lemonToast.info(+ 'Select all skips tables that are off by default. Check those tables one at a time to sync them.'+ )+ }+ }},})),urlToAction(({ actions, values }) => {diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceWizardLogic.test.ts b/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceWizardLogic.test.tsindex 35ff34b6158b..1cb811d05fb4 100644--- a/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceWizardLogic.test.ts+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceWizardLogic.test.ts@@ -1064,6 +1064,7 @@ describe('sourceWizardLogic', () => {buildSchema({ table: 'vault.decrypted_secrets', should_sync_default: false }),buildSchema({ table: 'vault.secrets', should_sync_default: false, should_sync: true }),])+ const toastInfo = jest.spyOn(lemonToast, 'info').mockImplementation(() => ({ id: 'x' }) as any)try {logic.actions.toggleAllTables(true)@@ -1071,11 +1072,15 @@ describe('sourceWizardLogic', () => {expect(byTable['Customer'].should_sync).toBe(true)expect(byTable['vault.decrypted_secrets'].should_sync).toBe(false)expect(byTable['vault.secrets'].should_sync).toBe(true)+ expect(toastInfo).toHaveBeenCalledWith(expect.stringContaining('off by default'))+ toastInfo.mockClear()logic.actions.toggleAllTables(false)byTable = Object.fromEntries(logic.values.databaseSchema.map((s) => [s.table, s]))expect(byTable['vault.secrets'].should_sync).toBe(false)+ expect(toastInfo).not.toHaveBeenCalled()} finally {+ toastInfo.mockRestore()unmount()}})