Skip to content

Workflow execution page can crash during polling #1598

@guanghuang

Description

@guanghuang

Problem

The workflow execution page can crash while polling run details with:

Cannot read properties of undefined (reading 'status')

The stack points at the React Query refetchInterval callback in WorkflowExecution, where the code assumes query.state.data.workflowState is always present when query.state.data exists.

Why it matters

When this happens, the error boundary replaces the page with "Something went wrong" and users have to reload manually. This is especially disruptive for long-running workflows where the execution page is used to monitor progress.

Expected behavior

Polling should tolerate transient or malformed query state and continue rendering a loading/error state instead of crashing the entire route.

Proposed fix

Guard the nested query data access in the polling callback and fail explicitly if the run detail response has no run payload.

Validation

Validated locally with:

bun --filter @archon/web type-check
bun test packages/web/src/lib/select-initial-node.test.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priority - Address soon, next in queuearea: webWeb UI (packages/web) - React frontendbugSomething is brokeneffort/mediumFew files, one domain or module, some coordination needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions