mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +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
@@ -245,4 +245,24 @@ describe('SessionDetail pending-actions polling gating', () => {
|
||||
const query = findPendingActionsQuery(queryClient)
|
||||
expect((query?.options as { refetchInterval?: unknown }).refetchInterval).toBe(false)
|
||||
})
|
||||
|
||||
it('requests message fallback polling while the SSE stream is disconnected', async () => {
|
||||
mocks.useSSE.mockReturnValue({ isConnected: false, isReconnecting: true })
|
||||
|
||||
const queryClient = createQueryClient()
|
||||
renderSessionDetail(queryClient)
|
||||
|
||||
const calls = mocks.useMessages.mock.calls
|
||||
expect(calls[calls.length - 1][3]).toEqual({ fallbackPoll: true })
|
||||
})
|
||||
|
||||
it('does not request message fallback polling while the SSE stream is connected', async () => {
|
||||
mocks.useSSE.mockReturnValue({ isConnected: true, isReconnecting: false })
|
||||
|
||||
const queryClient = createQueryClient()
|
||||
renderSessionDetail(queryClient)
|
||||
|
||||
const calls = mocks.useMessages.mock.calls
|
||||
expect(calls[calls.length - 1][3]).toEqual({ fallbackPoll: false })
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user