The app reports cache freshness but never its own code version #12

Closed
opened 2026-08-27 20:57:39 +02:00 by solvreven · 0 comments
Owner

This cost a live debugging session on 2026-08-27.

A fix to /api/matches was verified against the cache file and against stubbed
deps, and the tab still showed the old gameweek. Cause: the server process had
been running since 23 August. It had hot-reloaded the rebuilt cache
(built_at 2026-08-27T18:07) while running four-day-old code.

That state is invisible from the UI. /api/status reports built_at and drives
a staleness banner for the cache; nothing reports the server's own version.
So a process running stale logic against fresh data looks completely healthy —
green banner, numbers moving on every rebuild — and the only symptom is that a
fix you know landed does not appear.

The cache already carries built_from_sha. The running process should report
its own git SHA and start time beside it, so the two can be seen to
disagree
. CLAUDE.md's rule — "stamp artefacts with their build time and git
SHA, and print both in every report" — applied to the one artefact nobody
stamped: the server itself.

Suggested fix. Add server_sha and server_started_at to /api/status,
and surface a warning when server_sha != cache.built_from_sha.

**This cost a live debugging session on 2026-08-27.** A fix to `/api/matches` was verified against the cache file and against stubbed deps, and the tab still showed the old gameweek. Cause: the server process had been running since 23 August. It had **hot-reloaded the rebuilt cache** (`built_at 2026-08-27T18:07`) while running four-day-old code. That state is invisible from the UI. `/api/status` reports `built_at` and drives a staleness banner for the *cache*; nothing reports the *server's* own version. So a process running stale logic against fresh data looks completely healthy — green banner, numbers moving on every rebuild — and the only symptom is that a fix you know landed does not appear. The cache already carries `built_from_sha`. The running process should report its own git SHA and start time beside it, so the two can be **seen to disagree**. CLAUDE.md's rule — "stamp artefacts with their build time and git SHA, and print both in every report" — applied to the one artefact nobody stamped: the server itself. **Suggested fix.** Add `server_sha` and `server_started_at` to `/api/status`, and surface a warning when `server_sha != cache.built_from_sha`.
Sign in to join this conversation.
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
solvreven/FPL#12
No description provided.