Skip to content

[Fix-18448][ui] Fix releaseState undefined access in dag computed properties - #18449

Open
nanxiuzi wants to merge 1 commit into
apache:devfrom
nanxiuzi:fix/dag-release-state-undefined
Open

[Fix-18448][ui] Fix releaseState undefined access in dag computed properties#18449
nanxiuzi wants to merge 1 commit into
apache:devfrom
nanxiuzi:fix/dag-release-state-undefined

Conversation

@nanxiuzi

Copy link
Copy Markdown
Contributor

Summary

Fixes #18448

dag/index.tsx has two computed properties (startDisplay and menuDisplay) that access props.definition.workflowDefinition.releaseState without null-checking workflowDefinition. When workflowDefinition is undefined (e.g., the workflow is in a draft state, the definition was deleted but task instances still reference it, or the API response is missing the field), the access throws TypeError: Cannot read properties of undefined (reading 'releaseState') and breaks the DAG editor page.

Changes

  • dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx: replace props.definition!.workflowDefinition.releaseState with props.definition?.workflowDefinition?.releaseState in two computed properties (startDisplay at line 130, menuDisplay at line 152).

This matches the safe pattern already used in dag-toolbar.tsx (lines 276 and 512): props.definition?.workflowDefinition?.releaseState. No behavior change when workflowDefinition is defined — only the previously-crashing case now returns false (the same value the else branches already return).

Verification

  • pnpm run build:prod passes (vue-tsc type check + Vite production build).
  • Manual test on a 3.4.2 deployment: previously, clicking "Edit" on a task in the affected state produced Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'releaseState') in the browser console and the page stopped rendering. With this fix, the page renders correctly and the right-click menu items (startDisplay, menuDisplay) are hidden when workflowDefinition is undefined, which is the correct behavior since the user cannot meaningfully start/operate on a workflow that has no workflowDefinition.

Reproduce steps (for reviewers)

  1. Open a workflow definition in a state where props.definition.workflowDefinition is undefined (e.g., draft, or workflow definition just deleted but task instances still referencing it).
  2. Right-click a task node → "Edit".
  3. Without this PR: browser console shows Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'releaseState') and the DAG page stops rendering.
  4. With this PR: the page renders normally; the start button and "other" menu are hidden in the right-click menu (since workflowDefinition is undefined).

@nanxiuzi
nanxiuzi requested a review from SbloodyS as a code owner July 29, 2026 07:46
@github-actions github-actions Bot added the UI ui and front end related label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [UI] Clicking edit on a task throws "Cannot read properties of undefined (reading 'releaseState')" when workflowDefinition is undefined

1 participant