You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Jonghyun-An (via GitHub)" <gi...@apache.org> on 2026/10/03 06:28:44 UTC

[PR] UI: Fix XCom list crash when a value request fails [airflow]

Jonghyun-An opened a new pull request, #74131:
URL: https://github.com/apache/airflow/pull/74131

   An XCom entry can disappear between loading the list and fetching its value. The value request then returns 404, but `XComEntry` still tries to format `undefined` and throws `Cannot read properties of undefined (reading 'match')`. This replaces the entire list with an error page.
   
   Handle the query error in the affected value cell so the other entries remain visible and can still be copied. The cell shows the status and message on one line, with long messages truncated. Clicking the summary opens the full error in a popover without increasing the row height. Failed refetches also replace the stale value and its copy button with the error.
   
   ### Testing
   
   - `pnpm test src/pages/XCom/XComEntry.test.tsx` in Breeze: 6 passed; all 6 fail against the original component. Covers 404/403/500, a failed refetch, structured 422 details, and a network error.
   - File-scoped pre-commit and manual checks passed, including ESLint, Prettier, TypeScript, and the production UI build.
   - Checked the compiled UI in Chromium with mocked responses: error and healthy rows both stay at 57px. Verified long-message truncation, scrollable details, Enter/Space activation, Escape dismissal with focus restored, and a 390px viewport. No rendering errors.
   
   ### Screenshots
   
   | Before | After |
   | --- | --- |
   | ![XCom list replaced by a rendering error](https://airflow-xcom-review-a8661354.markajh.chatgpt.site/assets/before-7ac5ea4daf2e.png) | ![Single-line error with the remaining XCom entries visible](https://airflow-xcom-review-a8661354.markajh.chatgpt.site/assets/after-7ac5ea4daf2e.png) |
   
   [Expanded error details](https://airflow-xcom-review-a8661354.markajh.chatgpt.site/assets/details-7ac5ea4daf2e.png)
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — GPT-6.1-Sol
   
   Generated-by: GPT-6.1-Sol following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Fix XCom list crash when a value request fails [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #74131:
URL: https://github.com/apache/airflow/pull/74131#issuecomment-5966364400

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our [Contributors' Guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example Dag that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
   - Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Fix XCom list crash when a value request fails [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #74131:
URL: https://github.com/apache/airflow/pull/74131#discussion_r4185505570


##########
airflow-core/src/airflow/ui/src/pages/XCom/XComEntry.tsx:
##########
@@ -76,6 +78,47 @@ export const XComEntry = ({ dagId, mapIndex, open = false, runId, taskId, xcomKe
     taskId,
     xcomKey,
   });
+
+  if (Boolean(error)) {
+    const apiError = error as Partial<ExpandedApiError>;
+    const detail = apiError.body?.detail;
+    const summary = typeof detail === "string" ? detail : apiError.message;
+
+    return (
+      <Popover.Root lazyMount unmountOnExit>
+        <Popover.Trigger asChild>
+          <Button
+            color="fg.error"
+            data-testid="xcom-entry-error"
+            fontSize="sm"
+            gap={1}
+            justifyContent="flex-start"
+            maxW="min(15rem, 40vw)"
+            minW={0}
+            px={0}
+            size="xs"
+            variant="plain"
+          >
+            <FiAlertCircle aria-hidden="true" />
+            {apiError.status === undefined ? undefined : (
+              <Text as="span" flexShrink={0}>
+                {apiError.status}
+              </Text>
+            )}
+            <Text as="span" minW={0} truncate>
+              {summary}

Review Comment:
   Thanks! Since the errors get cut off anyway. Let's just keep the short status and alert circle inline and only show the full error in the popover.
   
   Please also show a screenshot of the popover.
   
   Finally, we have a lot of hardcoded maxH and maxW sizes. If the errors are so large, then we should probably follow how we do DagImportErrors and create a new shared ErrorModal component. Then the UX will be more consistent for large error messages across the UI



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Fix XCom list crash when a value request fails [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi merged PR #74131:
URL: https://github.com/apache/airflow/pull/74131


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Fix XCom list crash when a value request fails [airflow]

Posted by "Jonghyun-An (via GitHub)" <gi...@apache.org>.
Jonghyun-An commented on code in PR #74131:
URL: https://github.com/apache/airflow/pull/74131#discussion_r4192139356


##########
airflow-core/src/airflow/ui/src/pages/XCom/XComEntry.tsx:
##########
@@ -76,6 +78,47 @@ export const XComEntry = ({ dagId, mapIndex, open = false, runId, taskId, xcomKe
     taskId,
     xcomKey,
   });
+
+  if (Boolean(error)) {
+    const apiError = error as Partial<ExpandedApiError>;
+    const detail = apiError.body?.detail;
+    const summary = typeof detail === "string" ? detail : apiError.message;
+
+    return (
+      <Popover.Root lazyMount unmountOnExit>
+        <Popover.Trigger asChild>
+          <Button
+            color="fg.error"
+            data-testid="xcom-entry-error"
+            fontSize="sm"
+            gap={1}
+            justifyContent="flex-start"
+            maxW="min(15rem, 40vw)"
+            minW={0}
+            px={0}
+            size="xs"
+            variant="plain"
+          >
+            <FiAlertCircle aria-hidden="true" />
+            {apiError.status === undefined ? undefined : (
+              <Text as="span" flexShrink={0}>
+                {apiError.status}
+              </Text>
+            )}
+            <Text as="span" minW={0} truncate>
+              {summary}

Review Comment:
   Thanks! I’ve kept just the status and alert icon inline and moved the full error to an ErrorModal shared with Dag import errors. I’ve also added screenshots to the PR description.
   
   Please let me know if anything else needs adjusting!



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Fix XCom list crash when a value request fails [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #74131:
URL: https://github.com/apache/airflow/pull/74131#issuecomment-6025680491

   Awesome work, congrats on your first merged pull request! You are invited to check our [Issue Tracker](https://github.com/apache/airflow/issues) for additional contributions.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org