From b897369ef3cddd5ea4e6e41e1d387bcd8206a66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Engebr=C3=A5ten?= Date: Fri, 13 Feb 2026 16:06:58 +0100 Subject: [PATCH] fix(issues): persist enrichment to disk before notifying frontend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sendComplete() was firing before the enrichment file write finished, so the renderer's loadEnrichment() read stale data — resulting in 0% completeness and empty fields after triage. Co-Authored-By: Claude Opus 4.6 --- .../src/main/ipc-handlers/github/ai-triage-handlers.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/main/ipc-handlers/github/ai-triage-handlers.ts b/apps/frontend/src/main/ipc-handlers/github/ai-triage-handlers.ts index 23224ab1..294a2b82 100644 --- a/apps/frontend/src/main/ipc-handlers/github/ai-triage-handlers.ts +++ b/apps/frontend/src/main/ipc-handlers/github/ai-triage-handlers.ts @@ -176,9 +176,9 @@ export function registerAITriageHandlers( } const enrichmentResult = result.data as AIEnrichmentResult; - sendComplete(enrichmentResult); - // Persist enrichment data to local file + // Persist enrichment data to local file BEFORE notifying the frontend, + // so that loadEnrichment() in the renderer reads the updated file. try { await withEnrichmentFileLock(project.path, async () => { const enrichmentFile = await readEnrichmentFile(project.path); @@ -206,6 +206,8 @@ export function registerAITriageHandlers( error: persistErr instanceof Error ? persistErr.message : persistErr, }); } + + sendComplete(enrichmentResult); }); } catch (error) { sendError(error instanceof Error ? error.message : 'Failed to run enrichment');