From 0b6eaac5775804dd4c41b1ca3d4d866073a1db06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Engebr=C3=A5ten?= Date: Mon, 16 Feb 2026 09:18:12 +0100 Subject: [PATCH] debug(investigation): add logging to setGithubCommentId Add console logging to track when githubCommentId is set in the store. This helps diagnose race conditions and state synchronization issues. Logs: - Warning if called for non-existent investigation - Confirmation when githubCommentId and postedAt are set Co-Authored-By: Claude Sonnet 4.5 --- .../src/renderer/stores/github/investigation-store.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/renderer/stores/github/investigation-store.ts b/apps/frontend/src/renderer/stores/github/investigation-store.ts index 9855acb2..2d81fa36 100644 --- a/apps/frontend/src/renderer/stores/github/investigation-store.ts +++ b/apps/frontend/src/renderer/stores/github/investigation-store.ts @@ -324,9 +324,13 @@ export const useInvestigationStore = create((set, get) setGithubCommentId: (projectId: string, issueNumber: number, commentId: number) => set((state) => { const key = `${projectId}:${issueNumber}`; const existing = state.investigations[key]; - if (!existing) return state; + if (!existing) { + console.warn(`[InvestigationStore] setGithubCommentId called for non-existent investigation ${key}`); + return state; + } const now = new Date().toISOString(); const log = [...(existing.activityLog ?? []), { event: 'posted to GitHub', timestamp: now }].slice(-50); + console.log(`[InvestigationStore] Setting githubCommentId=${commentId} and postedAt=${now} for ${key}`); return { investigations: { ...state.investigations,