From 0836c815e48299b9b0642a68415be858cddda147 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sun, 22 Mar 2026 00:08:41 +0100 Subject: [PATCH] [fix](trx-frontend-http): restore global rig update in select_rig The previous commit conditionally skipped updating remote_active_rig_id when session_id was provided, but the remote client reads the global to route commands to the correct rig on trx-server. Restore the unconditional global update; cross-tab SSE isolation is handled by the rig_id query param on /events and the JS-side guard in applyRigList. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stan Grams --- .../trx-frontend/trx-frontend-http/src/api.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/trx-client/trx-frontend/trx-frontend-http/src/api.rs b/src/trx-client/trx-frontend/trx-frontend-http/src/api.rs index 2538364..d49f2f7 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/src/api.rs +++ b/src/trx-client/trx-frontend/trx-frontend-http/src/api.rs @@ -1619,14 +1619,17 @@ pub async fn select_rig( ))); } - // Update per-session rig selection if session_id is provided, otherwise - // update the global default (for non-session-aware clients). + // Always update the global active rig — the remote client uses it to + // route commands to the correct rig on the server. + if let Ok(mut active) = context.remote_active_rig_id.lock() { + *active = Some(rig_id.to_string()); + } + + // Update per-session rig selection if session_id is provided. if let Some(ref sid) = query.session_id { if let Ok(uuid) = Uuid::parse_str(sid) { session_rig_mgr.set_rig(uuid, rig_id.to_string()); } - } else if let Ok(mut active) = context.remote_active_rig_id.lock() { - *active = Some(rig_id.to_string()); } // Broadcast the channel list for the newly selected rig so all SSE