This is an automated email from the ASF dual-hosted git repository.
bbovenzi 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 ed10d7b053f UI: Fix task instance state badge staying stale after
Mark-as action (#67950)
ed10d7b053f is described below
commit ed10d7b053feedf6faa39b153df9e6df62dfa35b
Author: GayathriSrividya <[email protected]>
AuthorDate: Thu Jun 4 01:41:03 2026 +0530
UI: Fix task instance state badge staying stale after Mark-as action
(#67950)
Co-authored-by: Gayathri Srividya Rajavarapu
<[email protected]>
---
.../airflow/ui/src/queries/usePatchTaskInstance.ts | 26 +---------------------
1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/queries/usePatchTaskInstance.ts
b/airflow-core/src/airflow/ui/src/queries/usePatchTaskInstance.ts
index 0f0a5988ed8..6dfcc33cdb8 100644
--- a/airflow-core/src/airflow/ui/src/queries/usePatchTaskInstance.ts
+++ b/airflow-core/src/airflow/ui/src/queries/usePatchTaskInstance.ts
@@ -20,7 +20,6 @@ import { useQueryClient } from "@tanstack/react-query";
import { useTranslation } from "react-i18next";
import {
- UseTaskInstanceServiceGetMappedTaskInstanceKeyFn,
useTaskInstanceServiceGetMappedTaskInstanceKey,
UseTaskInstanceServiceGetTaskInstanceKeyFn,
useTaskInstanceServiceGetTaskInstancesKey,
@@ -65,36 +64,13 @@ export const usePatchTaskInstance = ({
[useTaskInstanceServiceGetTaskInstancesKey],
[usePatchTaskInstanceDryRunKey, dagId, dagRunId, { mapIndex, taskId }],
[useClearTaskInstancesDryRunKey, dagId],
+ [useTaskInstanceServiceGetMappedTaskInstanceKey, { dagId, dagRunId,
taskId }],
...tiPerAttemptQueryKeys,
];
- if (mapIndex !== undefined) {
- queryKeys.push(UseTaskInstanceServiceGetMappedTaskInstanceKeyFn({ dagId,
dagRunId, mapIndex, taskId }));
- }
-
await Promise.all([
...gridQueryKeys(dagId).map((key) => queryClient.invalidateQueries({
queryKey: key })),
...queryKeys.map((key) => queryClient.invalidateQueries({ queryKey: key
})),
- // Wildcard match when patching every mapped TI (mapIndex undefined):
- // invalidate the mapped-TI cache for every map_index of this task.
- // The mapped-TI key embeds its params as a single object, so prefix
- // matching on a partial key doesn't catch them — match via predicate.
- ...(mapIndex === undefined
- ? [
- queryClient.invalidateQueries({
- predicate: ({ queryKey }) => {
- if (queryKey[0] !==
useTaskInstanceServiceGetMappedTaskInstanceKey) {
- return false;
- }
- const params = queryKey[1] as
- | { dagId?: string; dagRunId?: string; taskId?: string }
- | undefined;
-
- return params?.dagId === dagId && params.dagRunId === dagRunId
&& params.taskId === taskId;
- },
- }),
- ]
- : []),
]);
if (onSuccess) {