Skip to content

Conversation

@rossnelson
Copy link
Collaborator

Summary

Fixes a race condition where the "No Workers Running" warning would briefly flash when opening a workflow, even when workers were actively running.

Root cause: The workflow-call-stack-error component checked !workers?.pollers?.length to show the warning, but the initial store state has pollers: []. When a workflow loaded, the warning would briefly appear before worker data finished loading.

Fix: Added a workersLoaded flag to the store to distinguish between:

  • "Workers are loading" (workersLoaded: false, pollers: [])
  • "Workers loaded with none found" (workersLoaded: true, pollers: [])

The warning now only shows in the second case.

Changes

  • src/lib/stores/workflow-run.ts - Added workersLoaded: boolean to store type
  • src/lib/layouts/workflow-run-layout.svelte - Sets workersLoaded: true after fetching
  • src/lib/components/workflow/workflow-call-stack-error.svelte - Checks workersLoaded before showing warning

Test plan

  • Open a workflow that has workers running - should NOT see the "No Workers Running" flash
  • Open a workflow with no workers polling its task queue - should still see the warning (after load completes)
  • Navigate between workflows - warning should not flash during transitions

Add workersLoaded flag to distinguish between "loading workers" and
"loaded with no workers" states. This fixes a race condition where the
warning would briefly appear before worker data finished loading.

The warning now only shows when workers have been definitively loaded
and found to be empty, not during the initial loading phase.
@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Feb 3, 2026 11:36pm

Request Review

@@ -97,7 +97,7 @@
const { taskQueue } = workflow;
const workers = await getPollers({ queue: taskQueue, namespace });

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Type 'WorkflowExecution | undefined' is not assignable to type 'WorkflowExecution | null'.

$workflowRun = { ...$workflowRun, workflow, workers, workersLoaded: true };

workflowRunController = new AbortController();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ 'workflow' is possibly 'undefined'.

export const initialWorkflowRun: WorkflowRunWithWorkers = {
workflow: null,
workers: { pollers: [], taskQueueStatus: null },
workersLoaded: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Type 'undefined' is not assignable to type 'WorkflowMetadata'.

@temporal-cicd
Copy link
Contributor

temporal-cicd bot commented Feb 3, 2026

Warnings
⚠️

📊 Strict Mode: 15 errors in 3 files (1.3% of 1183 total)

src/lib/stores/workflow-run.ts (1)
  • L23:2: Type 'undefined' is not assignable to type 'WorkflowMetadata'.
src/lib/components/workflow/workflow-call-stack-error.svelte (1)
  • L20:8: Type 'string | undefined' is not assignable to type 'string | number'.
src/lib/layouts/workflow-run-layout.svelte (13)
  • L43:6: Variable 'refreshInterval' implicitly has type 'any' in some locations where its type cannot be determined.
  • L94:29: Argument of type 'WorkflowExecution | undefined' is not assignable to parameter of type 'WorkflowExecution'.
  • L96:12: Property 'taskQueue' does not exist on type 'WorkflowExecution | undefined'.
  • L99:38: Type 'WorkflowExecution | undefined' is not assignable to type 'WorkflowExecution | null'.
  • L103:8: 'workflow' is possibly 'undefined'.
  • L113:8: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  • L126:19: 'workflow' is possibly 'undefined'.
  • L144:6: Type 'WorkflowExecution | undefined' is not assignable to type 'WorkflowExecution | null'.
  • L158:4: Type 'undefined' is not assignable to type 'NetworkError'.
  • L161:18: Variable 'refreshInterval' implicitly has an 'any' type.
  • L170:28: Parameter 'fullHistory' implicitly has an 'any' type.
  • L170:41: Parameter 'pause' implicitly has an 'any' type.
  • L202:35: Argument of type 'null' is not assignable to parameter of type '((key: string, value: { eventHistory: WorkflowEvents; workflow: WorkflowExecution | null; workers: IDescribeTaskQueueResponse; workersLoaded: boolean; metadata: WorkflowMetadata; userMetadata: { ...; }; }) => { ...; }) | undefined'.

Generated by 🚫 dangerJS against c342a11

const workers = await getPollers({ queue: taskQueue, namespace });

$workflowRun = { ...$workflowRun, workflow, workers };
$workflowRun = { ...$workflowRun, workflow, workers, workersLoaded: true };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we ever set this back to false onDestroy/navigate away from workflow page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants