From 9df1ddf2528d3805d6cfa3b957ab03318eb1a1bd Mon Sep 17 00:00:00 2001 From: ManthanNimodiya Date: Mon, 8 Jun 2026 16:02:19 +0530 Subject: [PATCH 1/2] fix(auth): stop infinite updateAuthPlan loop when org fetch always fails on self-hosted --- apps/desktop/src/utils/queries.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/desktop/src/utils/queries.ts b/apps/desktop/src/utils/queries.ts index 4b65b225bd0..fcf00fc66e8 100644 --- a/apps/desktop/src/utils/queries.ts +++ b/apps/desktop/src/utils/queries.ts @@ -351,12 +351,8 @@ export function createCustomDomainQuery() { export function createOrganizationsQuery() { const auth = authStore.createQuery(); - // Refresh organizations if they're missing createEffect(() => { - if ( - auth.data?.user_id && - (!auth.data?.organizations || auth.data.organizations.length === 0) - ) { + if (auth.data?.user_id && !auth.data?.organizations_updated_at) { commands.updateAuthPlan().catch(console.error); } }); From c19e55c402e0d3e27a079b59be49029d254e99e7 Mon Sep 17 00:00:00 2001 From: ManthanNimodiya Date: Mon, 8 Jun 2026 16:17:02 +0530 Subject: [PATCH 2/2] fix(auth): add comment explaining org refresh bootstrap guard --- apps/desktop/src/utils/queries.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/desktop/src/utils/queries.ts b/apps/desktop/src/utils/queries.ts index fcf00fc66e8..fd9d423c815 100644 --- a/apps/desktop/src/utils/queries.ts +++ b/apps/desktop/src/utils/queries.ts @@ -351,6 +351,7 @@ export function createCustomDomainQuery() { export function createOrganizationsQuery() { const auth = authStore.createQuery(); + // Bootstrap only: auth.rs stamps organizations_updated_at even on org-fetch failure, stopping the loop on self-hosted where the endpoint is absent. createEffect(() => { if (auth.data?.user_id && !auth.data?.organizations_updated_at) { commands.updateAuthPlan().catch(console.error);