From 58efb3b1ecddbb78e27b0855dbf3b65bbffd675b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 13 May 2026 02:53:40 +0000 Subject: [PATCH] fix(account): always include broadcasting relays in non-private sends MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ShortNotePost compose path went through `signAndComputeBroadcast` → `computeRelayListToBroadcast(event)`, which only mixed in the user's broadcasting relays indirectly via `outboxRelays` — and only when `author == userProfile()`. Two real paths dropped the broadcast list entirely: * Anonymous posts (`signAnonymouslyAndBroadcast`) sign with a throwaway pubkey, so `author != userProfile()` and the branch that pulls in `outboxRelays.flow.value` is skipped. * `MetadataEvent` / `AdvertisedRelayListEvent` returned early with `followPlusAllMineWithIndex + availableRelays`, neither of which includes the broadcast list. Hoist `broadcastRelayList.flow.value` to the top of the function (after the `GiftWrapEvent` / `WrappedEvent` early returns that defines what "private" means) and seed it into every non-private return path. Sets dedupe so the regular path stays unchanged in the common case where broadcasting relays were already reachable through `outboxRelays`. --- .../com/vitorpamplona/amethyst/model/Account.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 30ca6da76..8fac99545 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -937,10 +937,6 @@ class Account( private fun computeRelaysForChannels(event: Event): Set = cache.getAnyChannel(event)?.relays() ?: emptySet() fun computeRelayListToBroadcast(event: Event): Set { - if (event is MetadataEvent || event is AdvertisedRelayListEvent) { - // everywhere - return followPlusAllMineWithIndex.flow.value + client.availableRelaysFlow().value - } if (event is GiftWrapEvent) { val receiver = event.recipientPubKey() if (receiver != null) { @@ -959,7 +955,16 @@ class Account( return emptySet() } + // Non-private sends always go to the user's broadcasting relays. + val broadcastRelays = broadcastRelayList.flow.value + + if (event is MetadataEvent || event is AdvertisedRelayListEvent) { + // everywhere + return followPlusAllMineWithIndex.flow.value + client.availableRelaysFlow().value + broadcastRelays + } + val relayList = mutableSetOf() + relayList.addAll(broadcastRelays) val author = cache.getUserIfExists(event.pubKey)