Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@

import { QueryClient } from '@tanstack/react-query';

export const casesQueryClient = new QueryClient();
export const casesQueryClient = new QueryClient({
defaultOptions: {
queries: {
networkMode: 'always',
},
mutations: {
networkMode: 'always',
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,16 @@ import { DebugPage } from './sections/debug';

const FEEDBACK_URL = 'https://ela.st/fleet-feedback';

const queryClient = new QueryClient();
const queryClient = new QueryClient({
Copy link
Copy Markdown
Member

@nchaulet nchaulet May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice finding! We have a second client in Fleet for the integration app, it probably should have the same treatment https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/public/applications/integrations/app.tsx#L49

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nchaulet I implemented your remark, please take a look

defaultOptions: {
queries: {
networkMode: 'always',
},
mutations: {
networkMode: 'always',
},
},
});

export const WithPermissionsAndSetup = memo<{ children?: React.ReactNode }>(({ children }) => {
useBreadcrumbs('base');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ import { IntegrationsHeader } from './components/header';
import { AgentEnrollmentFlyout } from './components';
import { ReadOnlyContextProvider } from './hooks/use_read_only_context';

const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: {
queries: {
networkMode: 'always',
},
mutations: {
networkMode: 'always',
},
},
});

const EmptyContext = () => <></>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export class SecuritySolutionQueryClient extends QueryClient {
refetchOnWindowFocus: false,
refetchOnMount: true,
keepPreviousData: true,
...(options?.defaultOptions?.queries ?? {}),
...(options?.defaultOptions?.queries ?? { networkMode: 'always' }),
},
mutations: {
networkMode: 'always',
...(options?.defaultOptions?.mutations ?? { networkMode: 'always' }),
},
},
};
Expand Down
Loading