[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 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-22 00:08:41 +01:00
parent c332172900
commit 0836c815e4
@@ -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