fix(session): handle 404 with not-found fallbacks and add SSE-gated message polling (#316)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-07-23 09:40:12 -04:00
1 parent 632ce132bb
commit 8a8bdc18b0
5 files changed
+57 -4

No files matched your search

+2
View File
@@ -138,6 +138,7 @@ export const useSession = (opcodeUrl: string | null | undefined, sessionID: stri
refetchOnWindowFocus: true,
refetchOnReconnect: true,
staleTime: 15000,
retry: (failureCount, error) => !(error instanceof FetchError && error.statusCode === 404) && failureCount < 3,
});
};
@@ -158,6 +159,7 @@ export const useMessages = (opcodeUrl: string | null | undefined, sessionID: str
staleTime: 30000,
gcTime: 10 * 60 * 1000,
refetchInterval: opts?.fallbackPoll ? 5000 : undefined,
retry: (failureCount, error) => !(error instanceof FetchError && error.statusCode === 404) && failureCount < 3,
});
};