This is an automated email from the ASF dual-hosted git repository.
pierrejeambrun pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 538046160dc [v3-1-test] UI - Fix test connection (#57811) (#57852)
538046160dc is described below
commit 538046160dc3d078e22fcfeceaba0b876d41d028
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Nov 5 14:51:24 2025 +0100
[v3-1-test] UI - Fix test connection (#57811) (#57852)
(cherry picked from commit 0d30fb5afc064f20d95a803f5b0580861255cd82)
Co-authored-by: Pierre Jeambrun <[email protected]>
---
airflow-core/src/airflow/ui/src/queries/useTestConnection.ts | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
b/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
index f68b3c5d562..e31936a0ab3 100644
--- a/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
+++ b/airflow-core/src/airflow/ui/src/queries/useTestConnection.ts
@@ -16,21 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { useQueryClient } from "@tanstack/react-query";
import type { Dispatch, SetStateAction } from "react";
-import { useConnectionServiceTestConnection,
useConnectionServiceGetConnectionsKey } from "openapi/queries";
+import { useConnectionServiceTestConnection } from "openapi/queries";
import type { ConnectionTestResponse } from "openapi/requests/types.gen";
export const useTestConnection = (setConnected:
Dispatch<SetStateAction<boolean | undefined>>) => {
- const queryClient = useQueryClient();
-
- const onSuccess = async (res: ConnectionTestResponse) => {
- await queryClient.invalidateQueries({
- queryKey: [useConnectionServiceGetConnectionsKey],
- });
- setConnected(res.status);
- };
+ const onSuccess = (res: ConnectionTestResponse) => setConnected(res.status);
const onError = () => {
setConnected(false);