From 722d9526a1166b086aacbb301126d64e4682afa4 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Jul 2026 22:14:39 +0000 Subject: [PATCH] fix: log unparseable relay frames at WARN, not ERROR A frame the client can't decode (non-standard framing, unknown command, malformed JSON) is a relay-side quirk, not an Amethyst error. For example, multiplextr.coracle.social replies to a plain REQ with its own multiplexer envelope `[{"relays":[]},["NOTICE","","Unable to handle message"]]`, whose first element is an object rather than a command label, so the decoder throws `Message null is not supported`. BasicRelayClient already drops such frames and its comment states it "doesn't expose parsing errors to lib users as errors", yet it logged at ERROR. Downgrade to WARN so these relay-side quirks stop surfacing as app errors. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01THVD3sY6xrxGzBHhUnhJAY --- .../nip01Core/relay/client/single/basic/BasicRelayClient.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/single/basic/BasicRelayClient.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/single/basic/BasicRelayClient.kt index 5992cecdba..64e2052be5 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/single/basic/BasicRelayClient.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/single/basic/BasicRelayClient.kt @@ -160,8 +160,10 @@ open class BasicRelayClient( listener.onIncomingMessage(this@BasicRelayClient, text, msg) } catch (e: Throwable) { if (e is CancellationException) throw e - // doesn't expose parsing errors to lib users as errors - Log.e("BasicRelayClient", "Failure to parse message from ${url.url}: $text", e) + // A frame we can't parse is a relay-side quirk (non-standard framing, an + // unknown command, malformed JSON), not an Amethyst error. Drop it and log + // at WARN so it doesn't surface as an app error to lib users. + Log.w("BasicRelayClient", "Failure to parse message from ${url.url}: $text", e) } }