[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user