From 1bef6ab2ed2407ac115c85645b45e3406b642723 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 18 Jun 2026 03:48:07 +0000 Subject: [PATCH] fix: index poll option text cleanly in ZapPollEvent FTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ZapPollEvent.indexableContent() concatenated a List onto a String, so String.plus(Any?) appended the list's toString() — leaking literal "[", "]" and ", " separators into the full-text index (e.g. "Best color?[\nOption: Red, \nOption: Blue]"). Build the string explicitly so only the natural-language poll descriptors are indexed, matching the buildString style used by the music events. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01RFdWREvyvixRXnmNXNzmmN --- .../quartz/experimental/zapPolls/ZapPollEvent.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/experimental/zapPolls/ZapPollEvent.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/experimental/zapPolls/ZapPollEvent.kt index b22d81aede..fb86132026 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/experimental/zapPolls/ZapPollEvent.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/experimental/zapPolls/ZapPollEvent.kt @@ -63,7 +63,11 @@ class ZapPollEvent( AddressHintProvider, PubKeyHintProvider, SearchableEvent { - override fun indexableContent() = content + pollOptionsArray().map { "\nOption: " + it.descriptor } + override fun indexableContent() = + buildString { + append(content) + pollOptionsArray().forEach { append("\nOption: ").append(it.descriptor) } + } override fun eventHints(): List { val eHints = tags.mapNotNull(MarkedETag::parseAsHint)