From ef2ceffae85221cd0bf2a2d86878b667e7e7e015 Mon Sep 17 00:00:00 2001 From: g-but <41178744+g-but@users.noreply.github.com> Date: Sun, 31 May 2026 04:09:22 +0200 Subject: [PATCH] fix(system): MemorySummaryCard catches its own getEntityStats failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sibling RecentFailuresCard already defended against query failure with `.catch(() => [])`. MemorySummaryCard let getEntityStats throw straight through Suspense — the most likely root cause of the /system "Something went wrong" black-box screen that ee6df43 wrapped with an error.tsx boundary. Try/catch the query; render a small degraded card when the stats can't be loaded, explaining the rest of System is unaffected and the section will refresh on the next page load. Console.error keeps the postmortem signal even when Vercel logs are unreliable (pattern_vercel_log_fallback). Now both server-component Suspense children on /system are isolated — a failure in either renders a per-card degraded state instead of falling through to the route-level error boundary. The page itself stays functional. --- src/components/system/MemorySummaryCard.tsx | 26 ++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/components/system/MemorySummaryCard.tsx b/src/components/system/MemorySummaryCard.tsx index 417dd8e08..1ed87ae85 100644 --- a/src/components/system/MemorySummaryCard.tsx +++ b/src/components/system/MemorySummaryCard.tsx @@ -7,7 +7,31 @@ import Link from "next/link"; export async function MemorySummaryCard() { const userId = await requirePageUserId(); - const stats = await getEntityStats(userId); + // Match the defensive shape of sibling RecentFailuresCard + // (`getRecentDebugLogs(10).catch(() => [])`). Without this, any + // Neon-side error in getEntityStats propagated past Suspense into + // the route boundary and took the whole /system page down — the + // most likely cause of the "Something went wrong" black-box screen + // ee6df43 caught. Render a degraded card explaining what's missing + // instead of breaking the route. console.error keeps the postmortem + // signal even when Vercel logs are unreliable. + let stats: Awaited> | null = null; + try { + stats = await getEntityStats(userId); + } catch (err) { + console.error("[MemorySummaryCard] getEntityStats failed:", err); + } + + if (!stats) { + return ( + + +

+ Couldn't load knowledge-graph stats. The rest of System is unaffected; this section will refresh on the next page load. +

+
+ ); + } return (