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) ? (