Fix critical bug: usedTitles Set never populated

The getUniqueTitle() method was checking for duplicate titles but never
adding titles to the usedTitles Set, making duplicate prevention completely
ineffective. This caused file creation failures when OpenAI generated
multiple notes with identical titles.

Fix: Add title to usedTitles Set after generating unique name.

Fixes critical issue C1 from CODE_REVIEW.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mark Ayers 2025-10-12 19:41:53 -04:00
parent 635b1c6421
commit a476ad6cd1

View file

@ -46,6 +46,7 @@ export class NotesManager {
title = `${baseTitle} ${counter}`;
counter++;
}
this.usedTitles.add(title);
return normalizePath(title);
}
}