Skip to content

fix(statuses): don't 404 a group card when nothing is published (audit M6) - #436

Draft
passcod wants to merge 1 commit into
mainfrom
claude/pr-370-fix-m6-group-details-404
Draft

fix(statuses): don't 404 a group card when nothing is published (audit M6)#436
passcod wants to merge 1 commit into
mainfrom
claude/pr-370-fix-m6-group-details-404

Conversation

@passcod

@passcod passcod commented Aug 1, 2026

Copy link
Copy Markdown
Member

Fixes M6 (medium) from the audit in #370.

The bug

group_details resolved the latest published version with Version::get_latest_matching(conn, "*") and propagated the error with ?. That call returns NoMatchingVersions — which maps to 404 — when nothing is published at all.

So on a fresh deployment, or one where every version is still draft, group_details 404s for every group and the fleet status board renders empty or errored. The group exists and is perfectly healthy; the only thing missing is a release to compare against.

The two sibling endpoints needing the same value, servers::get_detail and statuses::snapshot, already map this to version_distance: None with a comment saying a page shouldn't 404 just because no versions are published yet. group_details was the odd one out.

The fix

Treat "no match" as "unknown latest", exactly as the siblings do: latest_version becomes an Option, and version_distance is None when either the card's version or the latest is unknown.

Tests

group_card_is_served_when_no_version_is_published — a group with a healthy production central and only a draft version; asserts 200, the group's name, and a null version_distance. Confirmed to fail against the unfixed handler with 404 NoMatchingVersions.


Generated by Claude Code

`group_details` resolved the latest published version with
`get_latest_matching(conn, "*")` and propagated the error with `?`. That call
returns `NoMatchingVersions` (→ 404) when nothing is published at all, so a
fresh deployment — or one where every version is still draft — 404s for every
group and the status board renders empty.

The two sibling endpoints that need the same value, `servers::get_detail` and
`statuses::snapshot`, already map this to `version_distance: None`, with a
comment saying a page shouldn't 404 just because no versions are published
yet. This does the same: no published version to measure against is an
unknown distance, not a missing group.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGfH1cdFKPnKpM7ytRThft
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