Merge pull request #105 from nioasoft/fix/assistant-conversation-404-handling

fix: handle 404 errors for deleted assistant conversations
This commit is contained in:
Leon van Zyl
2026-01-29 09:14:03 +02:00
committed by GitHub
2 changed files with 23 additions and 1 deletions

View File

@@ -26,6 +26,16 @@ export function useConversation(projectName: string | null, conversationId: numb
queryFn: () => api.getAssistantConversation(projectName!, conversationId!),
enabled: !!projectName && !!conversationId,
staleTime: 30_000, // Cache for 30 seconds
retry: (failureCount, error) => {
// Don't retry on "not found" errors (404) - conversation doesn't exist
if (error instanceof Error && (
error.message.toLowerCase().includes('not found') ||
error.message === 'HTTP 404'
)) {
return false
}
return failureCount < 3
},
})
}