fix(v032): AiWorker vocabSet COLLATE NOCASE 정합 (#31)

DB tags.name 가 COLLATE NOCASE 인데 vocabSet 은 strict-eq 였음 →
대문자/소문자 vocab 과 AI tag 가 다를 때 silently skip.

vocab.toLowerCase() + tagName.toLowerCase() 양쪽 normalize 로 정합.
This commit is contained in:
altair823
2026-05-10 13:55:52 +09:00
parent 36eafa1ce9
commit 6985db3505
2 changed files with 90 additions and 2 deletions

View File

@@ -186,9 +186,9 @@ export class AiWorker {
}).catch(() => {});
// v0.2.3 #3 — per-tag vocab hit/miss 분류 (updateAiResult 후 → tagId 보장)
// dedup: AI 응답에 같은 태그 중복 가능 — INSERT OR IGNORE 와 정합한 1-emit/태그 보장
const vocabSet = new Set(vocab);
const vocabSet = new Set(vocab.map((v) => v.toLowerCase()));
for (const tagName of new Set(res.tags)) {
if (vocabSet.has(tagName)) {
if (vocabSet.has(tagName.toLowerCase())) {
const tagId = this.repo.getTagIdByName(tagName);
if (tagId !== null) {
await this.telemetry.emit({