From 031e604923c15b1c864954a4c938e18556eecc68 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 21 Oct 2025 20:17:04 -0400 Subject: [PATCH] Only avoids sending a message for the request state if it is a new open request --- .../nip01Core/relay/client/pool/PoolRequests.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/pool/PoolRequests.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/pool/PoolRequests.kt index 0e505b132..dfda9bed5 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/pool/PoolRequests.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/pool/PoolRequests.kt @@ -230,13 +230,17 @@ class PoolRequests { sync: (NormalizedRelayUrl, Command) -> Unit, ) { relaysToUpdate.forEach { relay -> - val currentState = relayState.get(subId)?.currentState(relay) + sendToRelayIfChanged(subId, relay) { cmd -> + if (cmd is ReqCmd) { + val currentState = relayState.get(subId)?.currentState(relay) - if (currentState == ReqSubStatus.SENT || currentState == ReqSubStatus.QUERYING_PAST) { - // sending multiple REQs triggers multiple EOSEs back and we then don't know which - // one is which. - } else { - sendToRelayIfChanged(subId, relay) { cmd -> + if (currentState == ReqSubStatus.SENT || currentState == ReqSubStatus.QUERYING_PAST) { + // sending multiple REQs triggers multiple EOSEs back and we then don't know which + // one is which. + } else { + sync(relay, cmd) + } + } else { sync(relay, cmd) } }