fix: node detail wrongly shows 'offline' #15

Merged
james merged 1 commit from fix/node-detail-online-flag into main 2026-07-28 19:37:19 +00:00
Owner

The per-node header on the dashboard showed a red dot + "node offline" even though the tabs (same page) showed the node online with a green dot.

Cause: GET /api/nodes/:id returned the raw DB row via #find, which has no online field. The node list (/api/nodes) decorates each row with a computed online (last_seen within heartbeat_interval * 2), but the single-node detail didn't — so the frontend read online as falsy → offline.

Fix: add NodeRepository#find_with_status (decorates with the same online logic) and use it in the detail endpoint. Now the header agrees with the tabs.

Full suite green — 1133 examples.

🤖 Generated with Claude Code

The per-node header on the dashboard showed a red dot + "node offline" even though the tabs (same page) showed the node **online** with a green dot. Cause: `GET /api/nodes/:id` returned the raw DB row via `#find`, which has no `online` field. The node **list** (`/api/nodes`) decorates each row with a computed `online` (last_seen within `heartbeat_interval * 2`), but the single-node detail didn't — so the frontend read `online` as falsy → offline. Fix: add `NodeRepository#find_with_status` (decorates with the same online logic) and use it in the detail endpoint. Now the header agrees with the tabs. Full suite green — **1133 examples**. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ui): node detail wrongly shows "offline" (missing computed online flag)
All checks were successful
Build, Push & Deploy / build-and-push (pull_request) Has been skipped
Build, Push & Deploy / deploy (Media) (pull_request) Has been skipped
Build, Push & Deploy / deploy (citadel) (pull_request) Has been skipped
Build, Push & Deploy / test (pull_request) Successful in 1m6s
26cf58e41f
GET /api/nodes/:id returned the raw row via #find, without the computed
online/offline flag — so the dashboard's per-node header rendered a red dot +
"node offline" even while the node tabs (from /api/nodes, which decorates it)
showed it online.

Add NodeRepository#find_with_status (decorates with online = last_seen within
offline_after) and use it in the detail endpoint, matching the node-list feed.

Full suite green (1133 examples).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
james merged commit 053dc86730 into main 2026-07-28 19:37:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/baktainer!15
No description provided.