allow manual connection retry during backoff
This commit is contained in:
+3
-1
@@ -116,6 +116,7 @@
|
||||
let authBusy = false;
|
||||
let connectionNotice = '';
|
||||
let connectionCheckRunning = false;
|
||||
let connectionCheckGeneration = 0;
|
||||
let realtimeState = 'DISCONNECTED';
|
||||
let realtimeSocket: WebSocket | undefined;
|
||||
let activityEvents: Array<{ event_id: string; event_type: string; occurred_at: string }> = [];
|
||||
@@ -277,7 +278,7 @@
|
||||
}
|
||||
|
||||
async function checkServer() {
|
||||
if (connectionCheckRunning) return;
|
||||
const generation = ++connectionCheckGeneration;
|
||||
connectionCheckRunning = true;
|
||||
connectionState = 'CONNECTING';
|
||||
let attempt = 0;
|
||||
@@ -290,6 +291,7 @@
|
||||
} else {
|
||||
connectionNotice = 'Connecting to server';
|
||||
}
|
||||
if (generation !== connectionCheckGeneration) return;
|
||||
try {
|
||||
const response = await fetch(`${serverAddress}/api/v1/server/info`);
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
|
||||
Reference in New Issue
Block a user