fix(status): guard against empty serverId to avoid list-all-servers API calls (#2392)

When both server_id and server_name are missing from a connection record,
serverId falls back to "". Passing "" to fetchHetznerStatus/fetchDoStatus
constructs URLs like /v1/servers/ (list all), wasting rate-limit quota and
sending auth tokens to the wrong endpoint. Early-return "unknown" instead.

Agent: code-health

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-09 14:46:29 -07:00 committed by GitHub
parent 05f744e052
commit d73027eed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,6 +112,9 @@ async function checkServerStatus(record: SpawnRecord): Promise<LiveState> {
}
const serverId = conn.server_id || conn.server_name || "";
if (!serverId) {
return "unknown";
}
switch (conn.cloud) {
case "hetzner": {