Repository navigation
fix(systems): make status totals match the systems list - #259
Conversation
GET /systems/totals derived the status breakdown from the heartbeat age, while GET /systems filters on the systems.status column kept by the collect heartbeat monitor. The two disagreed on suspended systems, on unregistered ones, across the 15 vs 20 minute timeouts, and on restored systems: the dashboard counted inactive systems that the list then showed as pending, or not at all. Totals now count the status column with the same suspended exclusion as the list filter; the timeout parameter and field go away. Restoring a system that has reported before now sets it inactive instead of unknown, which the monitor never left on a silent system. Migration 060 fixes the systems already restored that way. Assisted-by: Claude Code:Opus 5.5
|
Two notes before merging, neither blocking. 1. Migration 060 will fire LinkFailed for the systems it moves The systems moved to SELECT count(*) FROM systems s
JOIN system_heartbeats h ON h.system_id = s.id
WHERE s.status = 'unknown' AND s.deleted_at IS NULL AND s.unregistered_at IS NULL;→ 1 system, not suspended, silent since 2026-10-29 10:40 UTC. So a single LinkFailed alert, which is the correct outcome. Nothing to warn partners about. 2.
Also: from now on the next migrations on |
The status badges of the dashboard systems card exclude suspended and unregistered systems, as the filtered lists they link to do, so they no longer add up to the total and read as a wrong count. The card now shows the total alone; the systems list keeps the status filter. Assisted-by: Claude Code:Opus 5.5
🚨 Breaking my.nethesis.it API change detectedStructural change detailsModified (1)
Powered by Bump.sh |
Solved by removing all badges from the Systems card |
📋 Description
The dashboard systems card could count inactive systems that the systems list, filtered by inactive, did not show: they appeared as pending, or not at all.
GET /systems/totalsderived the status from the heartbeat age, whileGET /systems?status=filters on thesystems.statuscolumn that the collect heartbeat monitor maintains, and the two disagree in several cases.The totals now count the status column with the same suspended exclusion as the list filter, so each count equals the filtered systems list. The dashboard card now shows only the total: its status badges excluded suspended and unregistered systems, as the lists do, so they no longer added up to the total. Restoring a soft-deleted system that has reported before now sets it
inactiveinstead ofunknown: the monitor only promotesunknownon a fresh heartbeat, so a silent restored system stayed pending forever.timeoutquery parameter and thetimeout_minutesresponse field of/systems/totalsare removed, as they no longer mean anything. The frontend never sent the parameter.unknownwith a heartbeat row toinactive. Those, like any silent restored system from now on, will raise LinkFailed. It is numbered 060 because 052-059 are taken onfeature/support-service.entities/local_systems.gois removed.Related Issue: None
🚀 Testing Environment
To trigger a fresh deployment of all services in the PR preview environment, comment:
Automatic PR environments:
How to test:
GET /systems/totalsand compareactive,inactiveandunknownwith the systems list filtered by each status: they match, also after suspending an inactive system.✅ Merge Checklist
Code Quality:
Builds: