From 2a0472ae428b703baffaef64c2d23f862dd90c55 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Mon, 3 Nov 2025 11:44:43 -0800 Subject: [PATCH] fix(search): resolve compilation issue due to variables with the same name --- .../search/expressions/note_content_fulltext.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/server/src/services/search/expressions/note_content_fulltext.ts b/apps/server/src/services/search/expressions/note_content_fulltext.ts index d459bdaf7..c36dddd74 100644 --- a/apps/server/src/services/search/expressions/note_content_fulltext.ts +++ b/apps/server/src/services/search/expressions/note_content_fulltext.ts @@ -96,14 +96,14 @@ class NoteContentFulltextExp extends Expression { // For exact match with flatText, also search notes WITHOUT content (they may have matching attributes) if (this.flatText && (this.operator === "=" || this.operator === "!=")) { - for (const noteId of inputNoteSet.noteIdSet) { + for (const note of inputNoteSet.notes) { // Skip if already found or doesn't exist - if (resultNoteSet.hasNoteId(noteId) || !(noteId in becca.notes)) { + if (resultNoteSet.hasNoteId(note.noteId) || !(note.noteId in becca.notes)) { continue; } - const note = becca.notes[noteId]; - const flatText = note.getFlatText(); + const noteFromBecca = becca.notes[note.noteId]; + const flatText = noteFromBecca.getFlatText(); // For flatText, only check attribute values (format: #name=value or ~name=value) // Don't match against noteId, type, mime, or title which are also in flatText @@ -116,7 +116,7 @@ class NoteContentFulltextExp extends Expression { matches = normalizedFlatText.includes(`=${normalizedPhrase}`); if ((this.operator === "=" && matches) || (this.operator === "!=" && !matches)) { - resultNoteSet.add(note); + resultNoteSet.add(noteFromBecca); } } }