Skip to content

Common Errors for Event History#3264

Open
Alex-Tideman wants to merge 15 commits intomainfrom
common-errors
Open

Common Errors for Event History#3264
Alex-Tideman wants to merge 15 commits intomainfrom
common-errors

Conversation

@Alex-Tideman
Copy link
Copy Markdown
Collaborator

@Alex-Tideman Alex-Tideman commented Apr 1, 2026

Summary

  • Adds a common errors system that detects 35 workflow/activity misconfigurations and surfaces them as warnings, errors, and info messages on the Workflow Details page.
  • Detection covers workflow timeouts, retry policies, continue-as-new patterns, activity timeouts, heartbeat issues, local activities, delayed start, ID reuse policies, and more
  • Includes a standalone /common-errors reference page with tab-based severity filtering
  • Refactors workflow-run-layout to Svelte 5 and adds a headerSnippet slot for injecting the common errors component

For this initial release, the Common Errors are not included by default to the Workflow Header. We will opt in to internally test first by including in the headerSnippet:

<WorkflowRunLayout>
  {#snippet headerSnippet()}
    <WorkflowCommonErrors />
  {/snippet}
  {@render children()}
</WorkflowRunLayout>

Test plan

  • There are two significant changes outside of Common Errors to test:
  1. Worklow Run Layout was converted to Svelte5, specifically with $effect and untrack to do data fetching. This is an important file that fetches our workflow data. High risk change.
  2. Alert component was converted to Svelte5. Low risk change.

To test common errors, you can include the above snippet and run workflows with any of the 35 scenarios such as a short workflowExecutionTimeout to view the error.

Screenshot 2026-04-01 at 3 58 17 PM Screenshot 2026-04-01 at 3 59 11 PM Screenshot 2026-04-07 at 12 07 39 PM Screenshot 2026-04-07 at 8 44 37 AM

…3262)

Create a reusable common-error component system for displaying operational
guidance about workflow misconfigurations. Includes typed data for 35 known
issues with severity levels, documentation links, and a /common-errors route.
Add automatic detection of 21 workflow configuration issues and display
them as warnings in the workflow header. Detection covers timeout
misconfigurations, retry policy issues, heartbeat settings, and more.
Also fixes raw code references in error titles.
@Alex-Tideman Alex-Tideman requested review from a team and rossedfort as code owners April 1, 2026 21:09
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

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

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Apr 8, 2026 9:10pm

Request Review

@Alex-Tideman Alex-Tideman marked this pull request as draft April 1, 2026 21:09
@temporal-cicd
Copy link
Copy Markdown
Contributor

temporal-cicd bot commented Apr 1, 2026

Warnings
⚠️

📊 Strict Mode: 16 errors in 3 files (1.5% of 1085 total)

src/lib/utilities/common-error-detection.ts (2)
  • L218:2: Type '(CommonError | undefined)[]' is not assignable to type 'CommonError[]'.
  • L443:2: Type '(CommonError | undefined)[]' is not assignable to type 'CommonError[]'.
src/lib/layouts/workflow-header.svelte (9)
  • L143:37: Argument of type 'WorkflowExecution | null' is not assignable to parameter of type 'WorkflowExecution'.
  • L144:45: Argument of type 'WorkflowExecution | null' is not assignable to parameter of type 'WorkflowExecution'.
  • L149:13: Type 'WorkflowExecution | null' is not assignable to type 'WorkflowExecution'.
  • L175:9: Type 'WorkflowExecution | null' is not assignable to type 'WorkflowExecution'.
  • L183:20: Type 'WorkflowExecution | null' is not assignable to type 'WorkflowExecution'.
  • L240:12: Type 'string | undefined' is not assignable to type 'string'.
  • L280:11: 'workflow' is possibly 'null'.
  • L322:12: 'workflow' is possibly 'null'.
  • L322:12: 'workflow.searchAttributes' is possibly 'undefined'.
src/lib/layouts/workflow-run-layout.svelte (5)
  • L111:39: Type 'string | undefined' is not assignable to type 'string'.
  • L161:6: Type 'WorkflowExecution | undefined' is not assignable to type 'WorkflowExecution | null'.
  • L175:4: Type 'undefined' is not assignable to type 'NetworkError | null'.
  • L178:18: No overload matches this call.
  • L236: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 | null; userMetadata: { ...; }; }) => { ...; }) | undefined'.

Generated by 🚫 dangerJS against 560f5fd

@Alex-Tideman Alex-Tideman changed the title Add common error warnings to workflow details Add common error warnings to Workflow details Apr 1, 2026
- Raise #31 threshold from 4000 to 10000 to match "significant additional events"
- Add null guards to all getCommonErrorById calls via addError helper
- Detect #3 (short timeout) from workflowRunTimeout on first event, not just execution timeout
- Fix #10 false positives for empty retry policy objects
- Handle protobuf nanos field in durationToSeconds for sub-second durations
Implement Tier 1 detections from existing data (#9, #11, #13, #15, #19,
#23, #35) and Tier 2 detections from event history scanning (#8, #12,
#26, #27, #28, #29, #30). Adds detectEventHistoryErrors with single-pass
scanning and updates getApplicableCommonErrors to accept optional event
history. All 35 error definitions now have active detection logic.
errorIds.add(23);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Type '(CommonError | undefined)[]' is not assignable to type 'CommonError[]'.

if (hasLocalActivityMarker && hasWftFailure) {
errorIds.add(30);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Type '(CommonError | undefined)[]' is not assignable to type 'CommonError[]'.

Update detectFirstEventErrors test calls to match updated function
signature that removed the workflow parameter. Add missing
routeForCommonErrors test case to route-for-base-path tests.
Switch from VerticalNav sidebar to TabButtons for severity filtering.
Remove layout reset (@) since the page no longer needs a custom layout.
Add WorkflowCommonErrors snippet to workflow run layout.
Rename $$Props to Props in alert.svelte for Svelte 5 convention.
Update stories to use module script and ComponentProps for proper
type inference with Storybook.
@Alex-Tideman Alex-Tideman changed the title Add common error warnings to Workflow details Common Errors for Event History Apr 7, 2026
@Alex-Tideman Alex-Tideman requested a review from laurakwhit April 7, 2026 14:59
@Alex-Tideman Alex-Tideman marked this pull request as ready for review April 7, 2026 14:59
Copy link
Copy Markdown
Contributor

@andrewzamojc andrewzamojc left a comment

Choose a reason for hiding this comment

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

I tested locally by adding the snippet and starting a workflow that triggered some common errors. Looks good 👍

$: (runId, clearWorkflowData());
$effect(() => {
runId;
untrack(() => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i assume all this untrack is nessesary?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah the way svelte5 works is it now tracks all the deps used in the function, not just the inputs. So this prevents overfetching.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants