From c697c48a825b137894084b4654508d0292acb375 Mon Sep 17 00:00:00 2001 From: Aravind Date: Thu, 30 Apr 2026 00:46:27 +0530 Subject: [PATCH] debezium/dbz#1725 fix: Improve loading state management in Platform UI Signed-off-by: Aravind --- debezium-platform-stage/src/main.tsx | 10 ++++++++-- .../src/pages/Connection/Connections.test.tsx | 2 +- .../src/pages/Connection/Connections.tsx | 6 +++--- .../src/pages/Destination/Destinations.test.tsx | 2 +- .../src/pages/Destination/Destinations.tsx | 10 +++++----- .../src/pages/Pipeline/Pipelines.test.tsx | 2 +- .../src/pages/Pipeline/Pipelines.tsx | 6 +++--- .../src/pages/Source/Sources.test.tsx | 2 +- debezium-platform-stage/src/pages/Source/Sources.tsx | 6 +++--- .../src/pages/Transforms/Transforms.test.tsx | 2 +- .../src/pages/Transforms/Transforms.tsx | 6 +++--- 11 files changed, 30 insertions(+), 24 deletions(-) diff --git a/debezium-platform-stage/src/main.tsx b/debezium-platform-stage/src/main.tsx index 28ab5df0..c7754295 100644 --- a/debezium-platform-stage/src/main.tsx +++ b/debezium-platform-stage/src/main.tsx @@ -8,11 +8,17 @@ import { StrictMode, Suspense } from 'react'; import './i18n'; // Create a client -const queryClient = new QueryClient(); +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: 3, + }, + }, +}); ReactDOM.createRoot(document.getElementById('root')!).render( - + diff --git a/debezium-platform-stage/src/pages/Connection/Connections.test.tsx b/debezium-platform-stage/src/pages/Connection/Connections.test.tsx index 3fb6b27a..17e97f04 100644 --- a/debezium-platform-stage/src/pages/Connection/Connections.test.tsx +++ b/debezium-platform-stage/src/pages/Connection/Connections.test.tsx @@ -81,7 +81,7 @@ describe("Connections", () => { return { data: undefined, error: null, isLoading: false } as any; }); render(); - expect(screen.getByText("Loading...")).toBeInTheDocument(); + expect(screen.getByRole("progressbar")).toBeInTheDocument(); }); it("shows API error when connections query fails", () => { diff --git a/debezium-platform-stage/src/pages/Connection/Connections.tsx b/debezium-platform-stage/src/pages/Connection/Connections.tsx index d7c0cffd..a966a979 100644 --- a/debezium-platform-stage/src/pages/Connection/Connections.tsx +++ b/debezium-platform-stage/src/pages/Connection/Connections.tsx @@ -75,6 +75,7 @@ const Connections: React.FunctionComponent = () => { data: connectionsList = [], error, isLoading: isConnectionsLoading, + failureCount: connectionsFailureCount, } = useQuery( "connections", () => fetchData(`${API_URL}/api/connections`), @@ -155,10 +156,10 @@ const Connections: React.FunctionComponent = () => { return (
- {error ? ( + {(!!error || connectionsFailureCount >= 3) ? (