From 3419cf8ef0e4ad948f5142780f773528af1a3bf8 Mon Sep 17 00:00:00 2001 From: Gagan Date: Tue, 14 Jul 2026 00:51:11 +0530 Subject: [PATCH] fix(x): don't overwrite same-titled meeting notes within a day MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note filenames derive from the meeting title, so every ad-hoc detected meeting (titled "Meeting") — and any recurring calendar event repeating its summary — resolved to the same file and each recording clobbered the previous one's notes. Suffix with the start timestamp when the path already exists. --- .../renderer/src/hooks/useMeetingTranscription.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/x/apps/renderer/src/hooks/useMeetingTranscription.ts b/apps/x/apps/renderer/src/hooks/useMeetingTranscription.ts index 75b4d91f..b47146ef 100644 --- a/apps/x/apps/renderer/src/hooks/useMeetingTranscription.ts +++ b/apps/x/apps/renderer/src/hooks/useMeetingTranscription.ts @@ -493,7 +493,16 @@ export function useMeetingTranscription(onAutoStop?: () => void) { const filename = calendarEvent?.summary ? calendarEvent.summary.replace(/[\\/*?:"<>|]/g, '').replace(/\s+/g, '_').substring(0, 100).trim() : `meeting-${timestamp}`; - const notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}.md`; + let notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}.md`; + // Title-derived names collide within a day — every ad-hoc detection is + // titled "Meeting", and recurring calendar events repeat their summary. + // Never overwrite an earlier meeting's note: suffix with the timestamp. + if (calendarEvent?.summary) { + try { + const { exists } = await window.ipc.invoke('workspace:exists', { path: notePath }); + if (exists) notePath = `knowledge/Meetings/rowboat/${dateFolder}/${filename}-${timestamp}.md`; + } catch { /* fall through with the unsuffixed path */ } + } notePathRef.current = notePath; calendarEventRef.current = calendarEvent;