From 15a225ea4c93458d2a1edb53ed90acc2ce937bcc Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Fri, 18 Sep 2026 01:23:23 +0200 Subject: [PATCH] fix(db-manager): retry a failed relations read on re-entry A failed read was cached like a successful one, so a transient worker or connection failure left the diagram without relations until the schema was reloaded or the manager remounted. The cache now only answers for a read that succeeded, and leaving the diagram and coming back retries. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01MXECAKye6KgN13wznsuRzP --- frontend/src/lib/components/DBManager.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/DBManager.svelte b/frontend/src/lib/components/DBManager.svelte index 5e17587d00..941dcde1bc 100644 --- a/frontend/src/lib/components/DBManager.svelte +++ b/frontend/src/lib/components/DBManager.svelte @@ -684,8 +684,10 @@ [() => viewMode, () => databaseKey, () => colDefs], async ([mode, key, defs], _prev, { data, signal }) => { // Re-read only when the database itself was reloaded: toggling back to - // the diagram must not queue the query again. - if (mode !== 'diagram' || (data?.databaseKey === key && data?.defs === defs)) return data + // the diagram must not queue the query again. A read that failed is not + // an answer about this database, so leaving and coming back retries it. + const answered = data?.databaseKey === key && data?.defs === defs && !data.failed + if (mode !== 'diagram' || answered) return data relationsError = undefined let read: DbRelation[] = [] let error: string | undefined @@ -700,7 +702,7 @@ // database's tables with this one's relations. if (signal.aborted) throw new DOMException('Superseded', 'AbortError') relationsError = error - return { databaseKey: key, defs, relations: read } + return { databaseKey: key, defs, relations: read, failed: error !== undefined } } ) // Relations are shown only alongside the database they were read from, so a