From b732cbaf5911a57edbeb96b8ea689f22002d6cf8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 18 Jun 2026 15:56:57 +0000 Subject: [PATCH] chore: temporary diagnostic logging for public chat relay targeting Logs the relay set targeted by the public-chat send path and the broadcast path under tag "PublicChatRelayDebug", so an on-device repro can show whether the channel-declared relay is actually in the target set. To be reverted once the declared-relay case is diagnosed. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01AYtHYEob2THu74inTxZxCh --- .../main/java/com/vitorpamplona/amethyst/model/Account.kt | 8 +++++++- .../publicChannels/send/ChannelNewMessageViewModel.kt | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index b2bcd2daf8..f7a58bb1fe 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -1403,7 +1403,13 @@ class Account( // missing signature. return } else { - client.publish(noteEvent, computeRelayListToBroadcast(note)) + val toRelays = computeRelayListToBroadcast(note) + // TEMP DIAGNOSTIC (public chat relay bug): what does broadcast target? + Log.w("PublicChatRelayDebug") { + "BROADCAST event=${noteEvent.id} kind=${noteEvent.kind} " + + "channelRelays=${cache.getAnyChannel(noteEvent)?.relays()} -> target=$toRelays" + } + client.publish(noteEvent, toRelays) } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/ChannelNewMessageViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/ChannelNewMessageViewModel.kt index 510b42a501..7b39cba381 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/ChannelNewMessageViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/ChannelNewMessageViewModel.kt @@ -301,6 +301,12 @@ open class ChannelNewMessageViewModel : val template = createTemplate() ?: return val channelRelays = channel?.relays() ?: emptySet() + // TEMP DIAGNOSTIC (public chat relay bug): what relays does the send target? + val pubChat = channel as? PublicChatChannel + Log.w("PublicChatRelayDebug") { + "SEND channel=${pubChat?.idHex} declared(info.relays)=${pubChat?.info?.relays} -> target=$channelRelays (empty target -> broadcast fallback)" + } + val version = draftTag.current cancel()