[fix](trx-frontend-http): remove global state mutation from select_rig

select_rig no longer mutates remote_active_rig_id — only the per-session
mapping is updated. This eliminates cross-tab leaking entirely: each tab
carries its own rig_id via the session manager, /events?rig_id, and
/status?rig_id query params.

The global remote_active_rig_id now only serves as the startup default
for brand-new sessions that have no rig_id yet.

Also fix the About section to show the per-tab lastActiveRigId instead
of the server's global active_rig_id.

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:20:34 +01:00
parent f3d8d349b1
commit 0e195bd3c6
2 changed files with 4 additions and 9 deletions
@@ -3116,8 +3116,8 @@ function render(update) {
if (typeof update.clients === "number") {
document.getElementById("about-clients").textContent = update.clients;
}
if (typeof update.active_rig_id === "string" && update.active_rig_id.length > 0) {
document.getElementById("about-active-rig").textContent = update.active_rig_id;
if (lastActiveRigId) {
document.getElementById("about-active-rig").textContent = lastActiveRigId;
}
if (Array.isArray(update.rig_ids)) {
applyRigList(update.active_rig_id, update.rig_ids);