From 7d5d0e1c0a7a168451ed16b1ffe7b6132264d750 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 10 Sep 2025 11:03:19 -0600 Subject: [PATCH 1/3] Add some logs in --- apps/web/src/routes/app.tsx | 3 +++ apps/web/src/routes/app/index.tsx | 1 + apps/web/src/routes/index.tsx | 1 + 3 files changed, 5 insertions(+) diff --git a/apps/web/src/routes/app.tsx b/apps/web/src/routes/app.tsx index 1cd33eb2d..b9ee5cf1e 100644 --- a/apps/web/src/routes/app.tsx +++ b/apps/web/src/routes/app.tsx @@ -15,6 +15,7 @@ export const Route = createFileRoute('/app')({ context: ({ context }) => ({ ...context, getAppLayout }), ssr: true, beforeLoad: async () => { + console.log('before load app'); const { isExpired, accessToken = '' } = await getSupabaseSession(); if (isExpired || !accessToken) { @@ -29,6 +30,7 @@ export const Route = createFileRoute('/app')({ loader: async ({ context }) => { const { queryClient, accessToken } = context; try { + console.log('loader app'); const [initialLayout, user] = await Promise.all([ getAppLayout({ id: PRIMARY_APP_LAYOUT_ID }), getSupabaseUser(), @@ -37,6 +39,7 @@ export const Route = createFileRoute('/app')({ prefetchListDatasources(queryClient), prefetchGetDatasets(queryClient), ]); + console.log('loader app done', user, initialLayout); if (!user) { throw redirect({ to: '/auth/login' }); diff --git a/apps/web/src/routes/app/index.tsx b/apps/web/src/routes/app/index.tsx index 7e96896a5..207f6ca8a 100644 --- a/apps/web/src/routes/app/index.tsx +++ b/apps/web/src/routes/app/index.tsx @@ -2,6 +2,7 @@ import { createFileRoute, redirect } from '@tanstack/react-router'; export const Route = createFileRoute('/app/')({ beforeLoad: async () => { + console.log('before load redirecting to app home'); throw redirect({ to: '/app/home' }); }, }); diff --git a/apps/web/src/routes/index.tsx b/apps/web/src/routes/index.tsx index 3db1a9f38..1e2b1f76b 100644 --- a/apps/web/src/routes/index.tsx +++ b/apps/web/src/routes/index.tsx @@ -2,6 +2,7 @@ import { createFileRoute, redirect } from '@tanstack/react-router'; export const Route = createFileRoute('/')({ beforeLoad: async () => { + console.log('before load redirecting to app'); throw redirect({ to: '/app/home' }); }, }); From 9210db08691db0b1d973b2fb0f0cf1b0b9d46f02 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 10 Sep 2025 11:07:49 -0600 Subject: [PATCH 2/3] Add in replace to router --- .../metric-server/metricIndexServerAssetContext.tsx | 1 + .../report-server/reportIndexServerAssetContext.tsx | 1 + apps/web/src/integrations/supabase/signOut.tsx | 2 +- apps/web/src/routes/app.tsx | 6 +++--- .../app/_app/datasets.$datasetId.permissions.index.tsx | 1 + apps/web/src/routes/app/_app/datasets.$datasetId.tsx | 1 + apps/web/src/routes/app/_settings/_permissions.tsx | 2 +- .../settings.dataset-groups.$datasetGroupId.index.tsx | 1 + .../routes/app/_settings/_restricted_layout/_admin_only.tsx | 2 +- apps/web/src/routes/app/_settings/settings.index.tsx | 1 + apps/web/src/routes/app/index.tsx | 3 ++- apps/web/src/routes/index.tsx | 3 ++- 12 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/web/src/context/BusterAssets/metric-server/metricIndexServerAssetContext.tsx b/apps/web/src/context/BusterAssets/metric-server/metricIndexServerAssetContext.tsx index cbd1e945a..29bf9ec98 100644 --- a/apps/web/src/context/BusterAssets/metric-server/metricIndexServerAssetContext.tsx +++ b/apps/web/src/context/BusterAssets/metric-server/metricIndexServerAssetContext.tsx @@ -13,5 +13,6 @@ export const beforeLoad = ({ params, search, unsafeRelative: 'path', + replace: true, }); }; diff --git a/apps/web/src/context/BusterAssets/report-server/reportIndexServerAssetContext.tsx b/apps/web/src/context/BusterAssets/report-server/reportIndexServerAssetContext.tsx index 367f8abb1..3a9b17967 100644 --- a/apps/web/src/context/BusterAssets/report-server/reportIndexServerAssetContext.tsx +++ b/apps/web/src/context/BusterAssets/report-server/reportIndexServerAssetContext.tsx @@ -13,5 +13,6 @@ export const beforeLoad = ({ params, search, unsafeRelative: 'path', + replace: true, }); }; diff --git a/apps/web/src/integrations/supabase/signOut.tsx b/apps/web/src/integrations/supabase/signOut.tsx index d4ab370f2..065ad9dfc 100644 --- a/apps/web/src/integrations/supabase/signOut.tsx +++ b/apps/web/src/integrations/supabase/signOut.tsx @@ -1,6 +1,5 @@ import { redirect } from '@tanstack/react-router'; import { createServerFn } from '@tanstack/react-start'; -import { parseCookies, setCookie } from '@tanstack/react-start/server'; import { getSupabaseServerClient } from './server'; export const signOut = createServerFn({ method: 'POST' }).handler(async () => { @@ -13,5 +12,6 @@ export const signOut = createServerFn({ method: 'POST' }).handler(async () => { throw redirect({ href: '/', + replace: true, }); }); diff --git a/apps/web/src/routes/app.tsx b/apps/web/src/routes/app.tsx index b9ee5cf1e..2de69d45f 100644 --- a/apps/web/src/routes/app.tsx +++ b/apps/web/src/routes/app.tsx @@ -20,7 +20,7 @@ export const Route = createFileRoute('/app')({ if (isExpired || !accessToken) { console.error('Access token is expired or not found'); - throw redirect({ to: '/auth/login' }); + throw redirect({ to: '/auth/login', replace: true }); } return { @@ -42,7 +42,7 @@ export const Route = createFileRoute('/app')({ console.log('loader app done', user, initialLayout); if (!user) { - throw redirect({ to: '/auth/login' }); + throw redirect({ to: '/auth/login', replace: true }); } return { @@ -54,7 +54,7 @@ export const Route = createFileRoute('/app')({ }; } catch (error) { console.error('Error in app route loader:', error); - throw redirect({ to: '/auth/login' }); + throw redirect({ to: '/auth/login', replace: true }); } }, component: () => { diff --git a/apps/web/src/routes/app/_app/datasets.$datasetId.permissions.index.tsx b/apps/web/src/routes/app/_app/datasets.$datasetId.permissions.index.tsx index c0b5851e9..d9c3baf3f 100644 --- a/apps/web/src/routes/app/_app/datasets.$datasetId.permissions.index.tsx +++ b/apps/web/src/routes/app/_app/datasets.$datasetId.permissions.index.tsx @@ -5,6 +5,7 @@ export const Route = createFileRoute('/app/_app/datasets/$datasetId/permissions/ throw redirect({ to: '/app/datasets/$datasetId/permissions/overview', params, + replace: true, }); }, }); diff --git a/apps/web/src/routes/app/_app/datasets.$datasetId.tsx b/apps/web/src/routes/app/_app/datasets.$datasetId.tsx index 07eb4b92a..2583cb941 100644 --- a/apps/web/src/routes/app/_app/datasets.$datasetId.tsx +++ b/apps/web/src/routes/app/_app/datasets.$datasetId.tsx @@ -12,6 +12,7 @@ export const Route = createFileRoute('/app/_app/datasets/$datasetId')({ throw redirect({ to: '/app/datasets/$datasetId/overview', params, + replace: true, }); } }, diff --git a/apps/web/src/routes/app/_settings/_permissions.tsx b/apps/web/src/routes/app/_settings/_permissions.tsx index 9b118dbbc..008053606 100644 --- a/apps/web/src/routes/app/_settings/_permissions.tsx +++ b/apps/web/src/routes/app/_settings/_permissions.tsx @@ -9,7 +9,7 @@ export const Route = createFileRoute('/app/_settings/_permissions')({ const { queryClient } = context; const userData = await prefetchGetMyUserInfo(queryClient); if (!userData || !userData.organizations || !checkIfUserIsAdmin(userData.organizations[0])) { - throw redirect({ to: '/auth/login' }); + throw redirect({ to: '/auth/login', replace: true }); } }, }); diff --git a/apps/web/src/routes/app/_settings/_permissions/settings.dataset-groups.$datasetGroupId.index.tsx b/apps/web/src/routes/app/_settings/_permissions/settings.dataset-groups.$datasetGroupId.index.tsx index de2c89dd8..c91be0495 100644 --- a/apps/web/src/routes/app/_settings/_permissions/settings.dataset-groups.$datasetGroupId.index.tsx +++ b/apps/web/src/routes/app/_settings/_permissions/settings.dataset-groups.$datasetGroupId.index.tsx @@ -7,6 +7,7 @@ export const Route = createFileRoute( throw redirect({ to: '/app/settings/dataset-groups/$datasetGroupId/datasets', params, + replace: true, }); }, }); diff --git a/apps/web/src/routes/app/_settings/_restricted_layout/_admin_only.tsx b/apps/web/src/routes/app/_settings/_restricted_layout/_admin_only.tsx index 543ab084e..40f2d747c 100644 --- a/apps/web/src/routes/app/_settings/_restricted_layout/_admin_only.tsx +++ b/apps/web/src/routes/app/_settings/_restricted_layout/_admin_only.tsx @@ -7,7 +7,7 @@ export const Route = createFileRoute('/app/_settings/_restricted_layout/_admin_o const { queryClient } = context; const userData = await prefetchGetMyUserInfo(queryClient); if (!userData || !userData.organizations || !checkIfUserIsAdmin(userData.organizations[0])) { - throw redirect({ to: '/auth/login' }); + throw redirect({ to: '/auth/login', replace: true }); } }, diff --git a/apps/web/src/routes/app/_settings/settings.index.tsx b/apps/web/src/routes/app/_settings/settings.index.tsx index 12e7d0580..12c2edd72 100644 --- a/apps/web/src/routes/app/_settings/settings.index.tsx +++ b/apps/web/src/routes/app/_settings/settings.index.tsx @@ -4,6 +4,7 @@ export const Route = createFileRoute('/app/_settings/settings/')({ beforeLoad: async () => { throw redirect({ to: '/app/settings/profile', + replace: true, }); }, }); diff --git a/apps/web/src/routes/app/index.tsx b/apps/web/src/routes/app/index.tsx index 207f6ca8a..72d794167 100644 --- a/apps/web/src/routes/app/index.tsx +++ b/apps/web/src/routes/app/index.tsx @@ -3,6 +3,7 @@ import { createFileRoute, redirect } from '@tanstack/react-router'; export const Route = createFileRoute('/app/')({ beforeLoad: async () => { console.log('before load redirecting to app home'); - throw redirect({ to: '/app/home' }); + throw redirect({ to: '/app/home', replace: true }); }, + component: () => null, }); diff --git a/apps/web/src/routes/index.tsx b/apps/web/src/routes/index.tsx index 1e2b1f76b..b6e0a964d 100644 --- a/apps/web/src/routes/index.tsx +++ b/apps/web/src/routes/index.tsx @@ -3,6 +3,7 @@ import { createFileRoute, redirect } from '@tanstack/react-router'; export const Route = createFileRoute('/')({ beforeLoad: async () => { console.log('before load redirecting to app'); - throw redirect({ to: '/app/home' }); + throw redirect({ to: '/app/home', replace: true }); }, + component: () => null, }); From 78f69d87d2c783aacfeb22c812d3d0d2aa553335 Mon Sep 17 00:00:00 2001 From: dal Date: Wed, 10 Sep 2025 11:13:41 -0600 Subject: [PATCH 3/3] 0.3.1 --- .github/workflows/cli-release.yml | 4 ++-- apps/cli/package.json | 2 +- apps/cli/src/index.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index aaf19378d..dd6487709 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -169,8 +169,8 @@ jobs: - name: Extract version from package.json id: get_version run: | - # Update this to 0.3.0 as requested - VERSION="0.3.0" + # Update this to 0.3.1 as requested + VERSION="0.3.1" echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Extracted version: $VERSION" diff --git a/apps/cli/package.json b/apps/cli/package.json index cbc7bbf66..5fcea3d16 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "@buster-app/cli", - "version": "0.3.0", + "version": "0.3.1", "description": "Buster CLI - TypeScript version", "type": "module", "bin": { diff --git a/apps/cli/src/index.tsx b/apps/cli/src/index.tsx index d75a4bf97..e2b0bbc0d 100644 --- a/apps/cli/src/index.tsx +++ b/apps/cli/src/index.tsx @@ -10,7 +10,7 @@ import { InitCommand } from './commands/init.js'; program .name('buster') .description('Buster CLI - AI-powered data analytics platform') - .version('0.3.0'); + .version('0.3.1'); // Auth command - authentication management program