Source: Full code review 2026-07-17 (docs/reviews/2026-07-17-full-code-review.md), finding F7.
Category: bug · Severity: low · Effort: small (frontend) / medium (API)
Problem
- The dashboard uses a falsy check —
if (snap.temperature && snap.temperature.celsius) (internal/web/assets/app.js:184-190) — so an exact 0 °C (plausible for a Pi in an unheated/outdoor enclosure) shows "n/a".
- Root cause is the API shape:
Snapshot.Temperature is always marshaled (internal/collector/types.go:118-134), and a failed collection yields {"zone": "", "celsius": 0}, so 0 is overloaded.
Suggested fix
- Within v1 (non-breaking): frontend keys off
temperature.zone !== '' (a successful reading always carries a zone) instead of the value's truthiness.
- Longer term: make the field a pointer (
*Temperature, omitted on failure like gpu_temperature) — a breaking change that would have to wait for /api/v2/.
Source: Full code review 2026-07-17 (
docs/reviews/2026-07-17-full-code-review.md), finding F7.Category: bug · Severity: low · Effort: small (frontend) / medium (API)
Problem
if (snap.temperature && snap.temperature.celsius)(internal/web/assets/app.js:184-190) — so an exact 0 °C (plausible for a Pi in an unheated/outdoor enclosure) shows "n/a".Snapshot.Temperatureis always marshaled (internal/collector/types.go:118-134), and a failed collection yields{"zone": "", "celsius": 0}, so0is overloaded.Suggested fix
temperature.zone !== ''(a successful reading always carries a zone) instead of the value's truthiness.*Temperature, omitted on failure likegpu_temperature) — a breaking change that would have to wait for/api/v2/.