mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
fix(session): handle 404 with not-found fallbacks and add SSE-gated message polling (#316)
This commit is contained in:
1 parent
632ce132bb
commit
8a8bdc18b0
5 files changed
+57
-4
No files matched your search
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user