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 cb80232a846 [v3-1-test] Fix dag list cache invalidation on favouriting 
a dag (#57039) (#57047)
cb80232a846 is described below

commit cb80232a8467451855b3a5e58b1c24917bb0a20c
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Oct 22 13:23:32 2025 +0200

    [v3-1-test] Fix dag list cache invalidation on favouriting a dag (#57039) 
(#57047)
    
    Fix dag list cache invalidation on favouriting a dag
    (cherry picked from commit 4e4621251a72a0737e7b918318630481f7a27981)
    
    Co-authored-by: Pierre Jeambrun <[email protected]>
---
 .../src/airflow/ui/src/queries/useToggleFavoriteDag.ts        | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/queries/useToggleFavoriteDag.ts 
b/airflow-core/src/airflow/ui/src/queries/useToggleFavoriteDag.ts
index d3cfaa7cf0c..6093177a64d 100644
--- a/airflow-core/src/airflow/ui/src/queries/useToggleFavoriteDag.ts
+++ b/airflow-core/src/airflow/ui/src/queries/useToggleFavoriteDag.ts
@@ -35,10 +35,13 @@ export const useToggleFavoriteDag = (dagId: string) => {
       queryKey: [useDagServiceGetDagsUiKey, UseDagServiceGetDagDetailsKeyFn({ 
dagId }, [{ dagId }])],
     });
 
-    // Invalidate the specific DAG details query for this DAG
-    await queryClient.invalidateQueries({
-      queryKey: UseDagServiceGetDagDetailsKeyFn({ dagId }, [{ dagId }]),
-    });
+    const queryKeys = [
+      // Invalidate the specific DAG details query for this DAG and DAGs list 
query.
+      UseDagServiceGetDagDetailsKeyFn({ dagId }, [{ dagId }]),
+      [useDagServiceGetDagsUiKey],
+    ];
+
+    await Promise.all(queryKeys.map((key) => queryClient.invalidateQueries({ 
queryKey: key })));
   }, [queryClient, dagId]);
 
   const favoriteMutation = useDagServiceFavoriteDag({

Reply via email to