From 01d2e006dcf6c79527582a7b267ea18111b36806 Mon Sep 17 00:00:00 2001 From: Sam Valladares Date: Sun, 19 Apr 2026 16:45:08 -0500 Subject: [PATCH] fix(dashboard): split empty-database from API-failure on the graph page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this, any exception from `api.graph()` — network down, dashboard disabled server-side, 500, 404 — surfaced as "No memories yet. Start using Vestige to populate your graph." Indistinguishable from a clean first-run install. Users couldn't tell whether Vestige was empty or actually broken. The fix checks both the error message shape (looks for 404 / not found / empty / "no memor" patterns) AND the last known graph node count. Only when both say "empty" do we keep the onboarding message; anything else surfaces the real error under "Failed to load graph: ..." so debugging doesn't require guessing. --- .../dashboard/src/routes/(app)/graph/+page.svelte | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/routes/(app)/graph/+page.svelte b/apps/dashboard/src/routes/(app)/graph/+page.svelte index 642fc4f..ae3d462 100644 --- a/apps/dashboard/src/routes/(app)/graph/+page.svelte +++ b/apps/dashboard/src/routes/(app)/graph/+page.svelte @@ -87,8 +87,19 @@ liveNodeCount = graphData.nodeCount; liveEdgeCount = graphData.edgeCount; } - } catch { - error = 'No memories yet. Start using Vestige to populate your graph.'; + } catch (e) { + // Distinguish "cold-start / empty database" from "actual API failure". + // Before v2.0.7 both surfaced as "No memories yet..." which masked + // real errors (network down, dashboard disabled, 500s) and looked + // identical to a first-run install. Split the two so debugging + // isn't a guessing game. + const msg = e instanceof Error ? e.message : String(e); + const isEmpty = + (graphData?.nodeCount ?? 0) === 0 && + /not found|404|empty|no memor/i.test(msg); + error = isEmpty + ? 'No memories yet. Start using Vestige to populate your graph.' + : `Failed to load graph: ${msg}`; } finally { loading = false; }