fix: prevent session creation loop when running without backend
Make getOrCreateSession idempotent by returning the existing active session when called with no ID, instead of always creating a new one. Use untrack() in the $effect to sever SvelteMap dependency so it only re-runs on $page changes. Disable SSR on client-only routes, reduce preload aggressiveness, and skip retries when already disconnected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -161,6 +161,11 @@ export async function* processRequest(
|
||||
let lastError: OrchestratorError | null = null;
|
||||
|
||||
for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
|
||||
// Skip retries if already known disconnected
|
||||
if (connectionStore.status === 'disconnected' && attempt > 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (attempt > 0) {
|
||||
connectionStore.setReconnecting();
|
||||
const delay = backoffDelay(attempt - 1);
|
||||
|
||||
Reference in New Issue
Block a user