From 92f8f78b0ecda67fd60ee0bbfb12a05abc6a6b35 Mon Sep 17 00:00:00 2001 From: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 Date: Fri, 19 Jun 2026 13:14:51 -0400 Subject: [PATCH] fix(desktop): stop labeling malformed relay responses as unreachable parse_json_response tagged a 2xx response with an undeserializable body as "relay unreachable:", the same prefix used for genuine transport failures. The reconcile log-guard suppresses that prefix, so a reached-but- malformed response (protocol mismatch, relay bug, corrupted body) was being silently swallowed instead of surfaced. Re-prefix it to "relay returned malformed response:" so it falls outside the unreachable bucket and logs loudly; the frontend connectivity classifier also correctly stops treating it as a connectivity failure. No other code reads the old string. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- desktop/src-tauri/src/relay.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/desktop/src-tauri/src/relay.rs b/desktop/src-tauri/src/relay.rs index 1ee3e8505..8d5f8f74e 100644 --- a/desktop/src-tauri/src/relay.rs +++ b/desktop/src-tauri/src/relay.rs @@ -211,11 +211,16 @@ pub(crate) async fn parse_json_response( return Err(msg); } - // Drop the reqwest error detail — it contains the raw URL. + // A successful HTTP response whose body fails to deserialize means the relay + // was reached but returned something unexpected (protocol mismatch, relay bug, + // corrupted body) — NOT a connectivity failure. Keep it off the + // "relay unreachable:" bucket so it surfaces loudly instead of being treated + // as a transient unreachable-relay condition. The reqwest error detail is + // dropped because it contains the raw URL. response .json::() .await - .map_err(|_| "relay unreachable: response was not valid JSON".to_string()) + .map_err(|_| "relay returned malformed response: not valid JSON".to_string()) } pub async fn relay_error_message(response: reqwest::Response) -> String {