Skip to content

Fix full-capacity Worker slot display - #3870

Open
miiiinju1 wants to merge 1 commit into
temporalio:mainfrom
miiiinju1:fix/full-capacity-worker-slot-display
Open

Fix full-capacity Worker slot display#3870
miiiinju1 wants to merge 1 commit into
temporalio:mainfrom
miiiinju1:fix/full-capacity-worker-slot-display

Conversation

@miiiinju1

@miiiinju1 miiiinju1 commented Aug 28, 2026

Copy link
Copy Markdown

Description and motivation

#3833 fixed the total slot calculation to use available slots plus used slots. One edge case remained: a zero available-slot count failed the existing truthiness check, so a Worker at full capacity rendered as 3 instead of 3/3.

Worker slot counts are proto3 scalar fields. The UI Server JSON marshaler omits zero-valued scalars, so currentAvailableSlots can also arrive as undefined when its protobuf value is zero. This change restores the protobuf zero defaults before rendering, while keeping -1 as unknown capacity and preserving the empty state when slot data is absent or both counts are zero.

Screenshots

Not applicable. The rendered states are covered by component tests.

Design considerations

The fallback applies only to counts within the existing slot display. A missing slot record still renders the existing empty state.

Testing

Added unit coverage for:

  • 0/3, 1/3, 2/3, and 3/3
  • nullish available counts using the protobuf zero default
  • the zero-slot empty state
  • unknown availability with -1
  • missing slot data

How was this tested

  • Manual testing
  • E2E tests added
  • Unit tests added

Validation completed:

  • pnpm exec vitest run src/lib/components/workers/worker-details/worker-details.svelte.test.ts: 9 tests passed
  • pnpm test --run: 3,142 tests passed and 2 skipped
  • pnpm lint:ci: passed with no errors
  • pnpm check: passed with no errors

Steps for others to test

Run:

pnpm exec vitest run src/lib/components/workers/worker-details/worker-details.svelte.test.ts

Checklists

Draft checklist

Ready for review.

Merge checklist

No follow-up changes are required.

Issues closed

None.

Docs

Any docs updates needed?

No.

@miiiinju1
miiiinju1 requested a review from a team as a code owner August 28, 2026 08:09
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@miiiinju1 is attempting to deploy a commit to the Temporal Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Aug 28, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Kim Minju <111269144+miiiinju1@users.noreply.github.com>
@miiiinju1
miiiinju1 force-pushed the fix/full-capacity-worker-slot-display branch from 5f9b760 to a96cced Compare August 28, 2026 08:40
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