From e46189e9ace2c92771ec8b2ae931eabb28d68e6d Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Tue, 24 Mar 2026 08:39:29 +0100 Subject: [PATCH] [fix](trx-client): use send_replace for per-rig audio stream info watch::Sender::send() silently discards the value when receiver_count is zero. The per-rig info channel is created with watch::channel().0 which drops the only Receiver, so the first send(Some(info)) after TCP connect returns early without storing the value. Later subscribers see None forever. send_replace() stores unconditionally. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stan Grams --- src/trx-client/src/audio_client.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trx-client/src/audio_client.rs b/src/trx-client/src/audio_client.rs index ac96877..1c4e8b2 100644 --- a/src/trx-client/src/audio_client.rs +++ b/src/trx-client/src/audio_client.rs @@ -325,7 +325,7 @@ async fn run_single_rig_audio_client( match changed { Ok(()) if *shutdown_rx.borrow() => { info!("Audio client [{}]: shutting down", rig_id); - let _ = per_rig_info_tx.send(None); + let _ = per_rig_info_tx.send_replace(None); if is_selected(&selected_rig_id, &rig_id) { let _ = global_info_tx.send(None); } @@ -431,7 +431,7 @@ async fn handle_single_rig_connection( "Audio stream info [{}]: {}Hz, {} ch, {}ms", rig_id, info.sample_rate, info.channels, info.frame_duration_ms ); - let _ = per_rig_info_tx.send(Some(info.clone())); + let _ = per_rig_info_tx.send_replace(Some(info.clone())); // Mirror to global if this is the selected rig. let is_selected = selected_rig_id