Fix full-capacity Worker slot display - #3870
Open
miiiinju1 wants to merge 1 commit into
Open
Conversation
|
@miiiinju1 is attempting to deploy a commit to the Temporal Team on Vercel. A member of the Team first needs to authorize it. |
Signed-off-by: Kim Minju <111269144+miiiinju1@users.noreply.github.com>
miiiinju1
force-pushed
the
fix/full-capacity-worker-slot-display
branch
from
August 28, 2026 08:40
5f9b760 to
a96cced
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
How was this tested
Validation completed:
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.