upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sync/relay_connection.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-19 12:03:09 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-19 12:08:05 +0000
commit00026a185b4b48d7179d02b50ea9e1802cd7e7e4 (patch)
tree06fd1abd38018f6e1e31734efdfbfe2bd9d1d9b4 /src/sync/relay_connection.rs
parent0228fa1e2fac86cfd2543444eef0784faa7a9715 (diff)
fix: prevent CLOSED messages from terminating relay connections
The system was incorrectly treating subscription-specific CLOSED messages as connection-wide disconnects, causing live subscriptions to be terminated immediately after historic_sync completed. Two bugs fixed: 1. relay_connection.rs: Removed break on RelayMessage::Closed - it's subscription-specific, not connection-wide 2. mod.rs: Removed disconnect handling for RelayEvent::Closed - only log at DEBUG level and continue All 41 sync tests now pass including previously failing live sync tests.
Diffstat (limited to 'src/sync/relay_connection.rs')
-rw-r--r--src/sync/relay_connection.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sync/relay_connection.rs b/src/sync/relay_connection.rs
index bc4b59e..fdb32cb 100644
--- a/src/sync/relay_connection.rs
+++ b/src/sync/relay_connection.rs
@@ -256,7 +256,8 @@ impl RelayConnection {
256 tracing::info!(relay = %url, message = %msg, "Relay closed subscription"); 256 tracing::info!(relay = %url, message = %msg, "Relay closed subscription");
257 let _ = 257 let _ =
258 event_sender.send(RelayEvent::Closed(msg.to_string())).await; 258 event_sender.send(RelayEvent::Closed(msg.to_string())).await;
259 break; 259 // Don't break - CLOSED is subscription-specific, not connection-specific
260 // The event loop should continue running for other active subscriptions
260 } 261 }
261 _ => {} 262 _ => {}
262 }, 263 },