jscheffl commented on code in PR #57207:
URL: https://github.com/apache/airflow/pull/57207#discussion_r2461656325


##########
airflow-core/src/airflow/ui/src/pages/HITLTaskInstances/HITLTaskInstances.tsx:
##########
@@ -127,28 +128,47 @@ export const HITLTaskInstances = () => {
   const [sort] = sorting;
   const responseReceived = searchParams.get(RESPONSE_RECEIVED_PARAM);
 
+  const baseRefetchInterval = useAutoRefresh({});
+
   const dagIdPattern = searchParams.get(DAG_DISPLAY_NAME_PATTERN) ?? undefined;
   const taskIdPattern = searchParams.get(TASK_ID_PATTERN) ?? undefined;
   const filterResponseReceived = searchParams.get(RESPONSE_RECEIVED_PARAM) ?? 
undefined;
 
   // Use the filter value if available, otherwise fall back to the old 
responseReceived param
   const effectiveResponseReceived = filterResponseReceived ?? responseReceived;
 
-  const { data, error, isLoading } = useTaskInstanceServiceGetHitlDetails({
-    dagId: dagId ?? "~",
-    dagIdPattern,
-    dagRunId: runId ?? "~",
-    limit: pagination.pageSize,
-    offset: pagination.pageIndex * pagination.pageSize,
-    orderBy: sort ? [`${sort.desc ? "-" : ""}${sort.id}`] : [],
-    responseReceived:
-      Boolean(effectiveResponseReceived) && effectiveResponseReceived !== "all"
-        ? effectiveResponseReceived === "true"
-        : undefined,
-    state: effectiveResponseReceived === "false" ? ["deferred"] : undefined,
-    taskId,
-    taskIdPattern,
-  });
+  const { data, error, isLoading } = useTaskInstanceServiceGetHitlDetails(
+    {
+      dagId: dagId ?? "~",
+      dagIdPattern,
+      dagRunId: runId ?? "~",
+      limit: pagination.pageSize,
+      offset: pagination.pageIndex * pagination.pageSize,
+      orderBy: sort ? [`${sort.desc ? "-" : ""}${sort.id}`] : [],
+      responseReceived:
+        Boolean(effectiveResponseReceived) && effectiveResponseReceived !== 
"all"
+          ? effectiveResponseReceived === "true"
+          : undefined,
+      state: effectiveResponseReceived === "false" ? ["deferred"] : undefined,
+      taskId,
+      taskIdPattern,
+    },
+    undefined,
+    {
+      // Only continue auto-refetching when filtering for unreceived responses
+      // and at least one TaskInstance is still deferred without a response.

Review Comment:
   Ah, that is why I have a de-ja-vue... this is the backport PR :-D



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to