Skip to content

fix(cluster): exclude deleted instances from the overview instance count#1434

Open
dawsontoth wants to merge 1 commit into
stagefrom
claude/cluster-instance-count-fix-c81554
Open

fix(cluster): exclude deleted instances from the overview instance count#1434
dawsontoth wants to merge 1 commit into
stagefrom
claude/cluster-instance-count-fix-c81554

Conversation

@dawsontoth

Copy link
Copy Markdown
Contributor

Closes #1432.

The managed-cluster overview header (ClusterHome) rendered cluster.instances?.length, counting every instance including ones in TERMINATING/TERMINATED/REMOVED states. The self-hosted overview in the same file and the Instances table both already filter those out via deletedClusterStatuses.

This applies the same filter to the managed header's count, and pluralizes ("1 instance" vs "n instances") to match the self-hosted branch.

Verification: ran the worktree dev server against stage and opened the Anvils cluster overview. Injected two fake instances (TERMINATED, REMOVED) into the react-query cache alongside the two real RUNNING ones (with a sentinel cluster name to prove the re-render happened from the mutated data): the header kept showing 2 instances while the sentinel name rendered — the old code would have shown 4. Full test suite (1240 tests), oxlint, and dprint pass.

🤖 Generated with Claude Code

The managed-cluster overview header counted every entry in
cluster.instances, including TERMINATING/TERMINATED/REMOVED ones. Filter
with deletedClusterStatuses like the self-hosted overview and the
Instances table already do, and pluralize to match.

Closes #1432

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dawsontoth dawsontoth requested a review from a team as a code owner July 9, 2026 14:31

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates ClusterHome.tsx to calculate the instance count by filtering out deleted instances and formats the output string to support singular and plural forms. The reviewer identified an issue where instances with an undefined status would be incorrectly excluded from the count and provided a code suggestion to fix this, while also advising that the same pattern be updated consistently across other components like SelfHostedClusterHome.

Comment thread src/features/cluster/ClusterHome.tsx
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.

Only count active instances in cluster count

1 participant