block / block/proto-fleet

[Bug] Racks allow adding more miners than available rack slots

Open
#691 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
55
Forks
16
Avg merge
1d 22h
Merged PRs (30d)
87

Description

## Describe the bug

Rack creation and rack editing both allow the user to end up with more miners in a rack than the rack has available slots.

This happens when the rack already contains unassigned miners and the user adds additional miners through either:
- `Search miners` while assigning a slot
- `+` from an unassigned rack slot

The rack limit is enforced in `Manage miners`, but not in these other flows.

This also appears in a related scenario:
- Create a large rack, for example `9x9`
- Add many miners
- Edit the rack settings down to `1x1`
- Save

The rack still keeps all previously added miners, which seems to be the same underlying issue: the user can save a rack with unassigned miners beyond the slot capacity, and they are not removed or blocked afterward.

## Preconditions

A rack exists or is being created with a finite slot count, and there are miners available that are not yet in the rack miner list.

## Steps to reproduce

1. Navigate to `Racks`
2. Click `Add rack`
3. Enter a rack name and choose `2x2`
4. Click `Continue`
5. Click `Manage miners`
6. Select the maximum allowed miners for the rack (`2x2 = 4 miners`)
7. Click `Continue`
8. Click one of the grid slots, for example `01`
9. Click `Search miners`
10. Select a miner that is not yet in the rack miner list
11. Click `Save`
12. Open the created rack
13. Click `+` on an unassigned rack slot
14. Select a miner that is not yet in the rack miner list

## Expected behavior

At steps 10 and 14, the user should be blocked from adding more miners once the rack slot limit has been reached.

Possible valid outcomes:
- Show a validation/error message that the rack limit has already been reached
- Redesign the flow so miners can temporarily exist in the rack list while editing, but any miners not assigned to slots are removed or rejected on save

In all cases, saving should not allow a rack to contain more miners than slots.

## Actual behavior

The action succeeds, and the rack ends up containing more miners than available slots.

This seems inconsistent with the intended product behavior, because `Manage miners` does enforce the maximum based on rack slot count.

## Proto Fleet version

`nightly-20260703-a7b00e867a12-13-g04a0c8c5-dirty`

## Environment

- OS: macOS
- Browser: Chrome

## Screenshots & screen recordings

https://github.com/user-attachments/assets/ad0230af-6b99-477f-b62b-482cab844906

https://github.com/user-attachments/assets/5c895149-669f-4655-90d0-3506b823fe16

Contributor guide

Open the contributing guide

Research direction

Start in the Racks creation and editing flows, following Manage miners, Search miners during slot assignment, and the + action on unassigned slots. Reproduce the 2x2 and resize-to-1x1 cases, then verify that adding or saving cannot leave more miners in the rack than its available slots.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.