Skip to content

Task failures count improvements#3216

Open
laurakwhit wants to merge 6 commits intomainfrom
task-failure-count-refresh
Open

Task failures count improvements#3216
laurakwhit wants to merge 6 commits intomainfrom
task-failure-count-refresh

Conversation

@laurakwhit
Copy link
Collaborator

@laurakwhit laurakwhit commented Mar 10, 2026

Description & motivation 💭

Problem:

  • If the user is on the "Task Failures" saved view and the task failure count updates the workflow listed does not update (unless the page is refreshed or the view is clicked on again).
  • The task failures count and workflow count polled independently on different intervals, causing them to show inconsistent data (e.g. task failures count could update before the workflow count did).

Solution:

  • Task failures count is now fetched in parallel with workflow counts on the same polling cycle on the workflows list page
  • Workflow statuses that previously had a count of zero but has a new count greater than zero will show up in the /workflows page header
  • The workflows refresh button has a label, badge styling around the new count, and a subtle animation a when there is a new count

Screenshots (if applicable) 📸

count-refresh-all-workflows.mov
count-refresh-task-failures.mov

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

On the /namespaces/{namespace}/workflows page

  • "Task Failures" count should update along with the workflows count

Run a workflow with a task failure*

  • "Task Failures" count should update
  • workflow count updates with +1
  • the workflow status should show 0 workflows with a +1 at the top of the page

*Run a workflow with a task failure using the samples-typescript/hello-world example

export async function example(name: string): Promise<string> {
  let count = 0;
  for (let i = 0; i < 2**53; i++) {
    count+=i;
  }
  console.log(`count: ${count}`);
  return await greet(name);
}
  const handle = await client.workflow.start(example, {
    ...,
    retry: {
      maximumAttempts: 5,
    },
    workflowTaskTimeout: '2 seconds',
  });

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

@vercel
Copy link

vercel bot commented Mar 10, 2026

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

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Mar 12, 2026 7:06pm

Request Review


export const fetchWorkflowTaskFailures = async (
namespace: string,
request = fetch,
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Function lacks ending return statement and return type does not include 'undefined'.

@temporal-cicd
Copy link
Contributor

temporal-cicd bot commented Mar 10, 2026

Warnings
⚠️

📊 Strict Mode: 12 errors in 4 files (1.1% of 1109 total)

src/lib/services/workflow-counts.ts (1)
  • L12:3: Function lacks ending return statement and return type does not include 'undefined'.
src/lib/components/workflow/workflow-counts.svelte (7)
  • L76:25: Parameter 'status' implicitly has an 'any' type.
  • L113:8: Type 'string | null' is not assignable to type 'string'.
  • L130:38: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  • L131:46: Argument of type 'never[] | { count: string; groupValues: IPayloads; }[] | undefined' is not assignable to parameter of type 'never[] | undefined'.
  • L141:41: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  • L142:49: Argument of type 'never[] | { count: string; groupValues: IPayloads; }[] | undefined' is not assignable to parameter of type 'never[] | undefined'.
  • L192:14: Object is possibly 'undefined'.
src/lib/pages/saved-query-views.svelte (3)
  • L390:8: 'view.count' is possibly 'undefined'.
  • L397:51: 'view.count' is possibly 'undefined'.
  • L152:25: 'activeQueryView' is possibly 'undefined'.
src/lib/pages/workflows-with-new-search.svelte (1)
  • L90:4: Type 'string | null' is not assignable to type 'string'.

Generated by 🚫 dangerJS against aa559ab

@laurakwhit laurakwhit changed the title Add task failures count refresh Task failures count improvements Mar 10, 2026
loading = true;
try {
const { count, groups } = await fetchCounts();
$workflowCount.count = parseInt(count);
Copy link
Contributor

@temporal-cicd temporal-cicd bot Mar 10, 2026

Choose a reason for hiding this comment

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

  • ⚠️ Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

return { count: '0', groups: [] };
});
const { count, groups } = await fetchCounts();
$workflowCount.newCount = parseInt(count) - $workflowCount.count;
Copy link
Contributor

@temporal-cicd temporal-cicd bot Mar 10, 2026

Choose a reason for hiding this comment

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

  • ⚠️ Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

const [{ count, groups }] = await Promise.all([
fetchWorkflowCountByExecutionStatus({
namespace,
query,
Copy link
Contributor

Choose a reason for hiding this comment

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

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

try {
const { count, groups } = await fetchCounts();
$workflowCount.count = parseInt(count);
statusGroups = getStatusAndCountOfGroup(groups);
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Argument of type 'never[] | { count: string; groupValues: IPayloads; }[] | undefined' is not assignable to parameter of type 'never[] | undefined'.

});
const { count, groups } = await fetchCounts();
$workflowCount.newCount = parseInt(count) - $workflowCount.count;
newStatusGroups = getStatusAndCountOfGroup(groups);
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Argument of type 'never[] | { count: string; groupValues: IPayloads; }[] | undefined' is not assignable to parameter of type 'never[] | undefined'.

@laurakwhit laurakwhit marked this pull request as ready for review March 12, 2026 20:54
@laurakwhit laurakwhit requested review from a team, Alex-Tideman and rossedfort as code owners March 12, 2026 20:54
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.

2 participants