RoyLee1224 commented on code in PR #54049:
URL: https://github.com/apache/airflow/pull/54049#discussion_r2268066614


##########
airflow-core/src/airflow/ui/src/pages/XCom/XCom.tsx:
##########
@@ -103,25 +113,55 @@ export const XCom = () => {
   const { t: translate } = useTranslation(["browse", "common"]);
   const { setTableURLState, tableURLState } = useTableURLState();
   const { pagination } = tableURLState;
+  const [searchParams] = useSearchParams();
 
-  const { data, error, isFetching, isLoading } = useXcomServiceGetXcomEntries(
-    {
-      dagId,
-      dagRunId: runId,
-      limit: pagination.pageSize,
-      mapIndex: mapIndex === "-1" ? undefined : parseInt(mapIndex, 10),
-      offset: pagination.pageIndex * pagination.pageSize,
-      taskId,
-    },
-    undefined,
-    { enabled: !isNaN(pagination.pageSize) },
-  );
+  const filteredKey = searchParams.get(KEY_PATTERN_PARAM);
+  const filteredDagDisplayName = 
searchParams.get(DAG_DISPLAY_NAME_PATTERN_PARAM);
+  const filteredMapIndex = searchParams.get(MAP_INDEX_PARAM);
+  const filteredRunId = searchParams.get(RUN_ID_PATTERN_PARAM);
+  const filteredTaskId = searchParams.get(TASK_ID_PATTERN_PARAM);
+
+  const { LOGICAL_DATE_GTE, LOGICAL_DATE_LTE, RUN_AFTER_GTE, RUN_AFTER_LTE } = 
SearchParamsKeys;
+
+  const logicalDateGte = searchParams.get(LOGICAL_DATE_GTE);
+  const logicalDateLte = searchParams.get(LOGICAL_DATE_LTE);
+  const runAfterGte = searchParams.get(RUN_AFTER_GTE);
+  const runAfterLte = searchParams.get(RUN_AFTER_LTE);
+
+  const apiParams = {
+    dagDisplayNamePattern: filteredDagDisplayName ?? undefined,
+    dagId,
+    dagRunId: runId,
+    limit: pagination.pageSize,
+    logicalDateGte: logicalDateGte ?? undefined,
+    logicalDateLte: logicalDateLte ?? undefined,
+    mapIndex:
+      filteredMapIndex !== null && filteredMapIndex !== ""
+        ? parseInt(filteredMapIndex, 10)
+        : mapIndex === "-1"
+          ? undefined
+          : parseInt(mapIndex, 10),
+    offset: pagination.pageIndex * pagination.pageSize,
+    runAfterGte: runAfterGte ?? undefined,
+    runAfterLte: runAfterLte ?? undefined,
+    runIdPattern: filteredRunId ?? undefined,
+    taskId,
+    taskIdPattern: filteredTaskId ?? undefined,
+    xcomKeyPattern: filteredKey ?? undefined,
+  };
+
+  const { data, error, isFetching, isLoading } = 
useXcomServiceGetXcomEntries(apiParams, undefined, {
+    enabled: !isNaN(pagination.pageSize),

Review Comment:
   According to #44989 and its following PR, `enabled: !isNaN(pageSize)` check 
was a defensive fix for a race condition. 
   
   And this issue seems to be resolved in PR #45095, which uses a router loader 
to ensure the config is always pre-loaded. 
   
   I have locally removed this check and seems like the original bug does not 
reappear.
   
   I found this same redundant check in several other files as well (e.g., 
XCom.tsx, DagRuns.tsx, TaskInstances.tsx, etc.).
   
   Should I remove this single instance here, or should I open a dedicated new 
PR to clean up all of them at once?
    I lean towards a separate PR for better tracking, but I'm happy to follow 
your guidance.



-- 
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