[fix](trx-frontend-http): pass rig_id to SSE endpoint on reconnect

After select_rig stopped mutating the global remote_active_rig_id for
session-aware clients, SSE reconnects would fall back to the old global
default instead of the newly selected rig. Now connect() passes
lastActiveRigId as a rig_id query param to /events, and the server
prefers it over the global default when present.

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:04:36 +01:00
parent b9e1601730
commit c332172900
2 changed files with 24 additions and 8 deletions
@@ -3183,7 +3183,10 @@ function connect() {
clearInterval(esHeartbeat);
}
pollFreshSnapshot();
es = new EventSource("/events");
const eventsUrl = lastActiveRigId
? `/events?rig_id=${encodeURIComponent(lastActiveRigId)}`
: "/events";
es = new EventSource(eventsUrl);
lastEventAt = Date.now();
es.onopen = () => {
setConnLostOverlay(false);