Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(web,sentry): handle authClient.getSession() network errors in workspace settings

(justin)randoneering08059ba7002a
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx
index 171e1b0e9..0efa486c6 100644
--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx
@@ -34,8 +34,15 @@ export const Route = createFileRoute(
// sidebar ("WS / Roles.Undefined") and a stuck "Loading…", so pick the first
// workspace as active so the layout has something to render.
beforeLoad: async () => {
- const session = await authClient.getSession();
- if (session?.data?.session?.activeOrganizationId) return;
+ let session = null;
+ try {
+ const { data } = await authClient.getSession();
+ session = data;
+ } catch (error) {
+ if (import.meta.env.DEV) console.warn("getSession failed", error);
+ // getSession() rejected (e.g. network error) — continue to workspace fallback
+ }
+ if (session?.session?.activeOrganizationId) return;
const workspaces = await getWorkspaces();
if (workspaces.length === 0) {