From f2fdeb13fe9d5aa257b2a1b8db9d7647b0fa84e9 Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Sat, 17 Jan 2026 09:40:24 +0000 Subject: [PATCH] Revert "don't hide tasks if streams fail (#2053)" This reverts commit 0d6f51265b60fa6afa4b1a434c8e3ceece16af93. --- frontend/src/hooks/useJsonPatchWsStream.ts | 14 +++----------- frontend/src/pages/ProjectTasks.tsx | 11 +++-------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/frontend/src/hooks/useJsonPatchWsStream.ts b/frontend/src/hooks/useJsonPatchWsStream.ts index 6f55c137..8a017935 100644 --- a/frontend/src/hooks/useJsonPatchWsStream.ts +++ b/frontend/src/hooks/useJsonPatchWsStream.ts @@ -193,8 +193,9 @@ export const useJsonPatchWsStream = ( retryTimerRef.current = null; } finishedRef.current = false; - // Preserve data during reconnection attempts - only clear on unmount/disable - // Data will be refreshed when the new connection receives its initial snapshot + dataRef.current = undefined; + setData(undefined); + setIsInitialized(false); }; }, [ endpoint, @@ -205,14 +206,5 @@ export const useJsonPatchWsStream = ( retryNonce, ]); - // Clear data when the stream is disabled (separate effect to avoid clearing on reconnect) - useEffect(() => { - if (!enabled) { - dataRef.current = undefined; - setData(undefined); - setIsInitialized(false); - } - }, [enabled]); - return { data, isConnected, isInitialized, error }; }; diff --git a/frontend/src/pages/ProjectTasks.tsx b/frontend/src/pages/ProjectTasks.tsx index 98f73e6f..f16c70e5 100644 --- a/frontend/src/pages/ProjectTasks.tsx +++ b/frontend/src/pages/ProjectTasks.tsx @@ -152,7 +152,6 @@ export function ProjectTasks() { const { projectId, - project, isLoading: projectLoading, error: projectError, } = useProject(); @@ -846,8 +845,7 @@ export function ProjectTasks() { const isInitialTasksLoad = isLoading && tasks.length === 0; - // Only show full-page error if we have no project data at all - if (projectError && !project) { + if (projectError) { return (
@@ -1087,18 +1085,15 @@ export function ProjectTasks() { ); - const connectionError = - streamError || (projectError && project ? projectError.message : null); - return (
- {connectionError && ( + {streamError && ( {t('common:states.reconnecting')} - {connectionError} + {streamError} )}