This is an automated email from the ASF dual-hosted git repository.
rahulvats pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 4e4621251a7 Fix dag list cache invalidation on favouriting a dag
(#57039)
4e4621251a7 is described below
commit 4e4621251a72a0737e7b918318630481f7a27981
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Wed Oct 22 12:24:40 2025 +0200
Fix dag list cache invalidation on favouriting a dag (#57039)
Fix dag list cache invalidation on favouriting a dag
---
.../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({