Revert "don't hide tasks if streams fail (#2053)"

This reverts commit 0d6f51265b.
This commit is contained in:
Louis Knight-Webb
2026-01-17 09:40:24 +00:00
parent 4ffd7c92b9
commit f2fdeb13fe
2 changed files with 6 additions and 19 deletions

View File

@@ -193,8 +193,9 @@ export const useJsonPatchWsStream = <T extends object>(
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 = <T extends object>(
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 };
};

View File

@@ -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 (
<div className="p-4">
<Alert>
@@ -1087,18 +1085,15 @@ export function ProjectTasks() {
</GitOperationsProvider>
);
const connectionError =
streamError || (projectError && project ? projectError.message : null);
return (
<div className="h-full flex flex-col">
{connectionError && (
{streamError && (
<Alert className="w-full z-30 xl:sticky xl:top-0">
<AlertTitle className="flex items-center gap-2">
<AlertTriangle size="16" />
{t('common:states.reconnecting')}
</AlertTitle>
<AlertDescription>{connectionError}</AlertDescription>
<AlertDescription>{streamError}</AlertDescription>
</Alert>
)}