fix(x): don't overwrite same-titled meeting notes within a day

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.
This commit is contained in:
Gagan 2026-07-14 00:51:11 +05:30
parent 95f232cca9
commit 3419cf8ef0

View file

@ -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;