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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AYtHYEob2THu74inTxZxCh
This commit is contained in:
Claude
2026-06-18 15:56:57 +00:00
parent 840868d315
commit b732cbaf59
2 changed files with 13 additions and 1 deletions
@@ -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)
}
}
}
@@ -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()