Interval change keeps unreported samples for the reporter (closes #124)
check / check (push) Successful in 2m9s

The interval menu cleared every host's history, and the reporter builds
each report from that history, so the samples recorded since the last
delivered report were never sent. The menu now calls
HostState.clearHistory, which moves the history's entries to
clearedHistory, keeping the last maxHistoryPoints as the history does;
buildReport reads both. The per-host marks are unchanged, so a sample a
delivered report had is not sent again, and the page's history still
starts over. Reporter is exported for the new unit test.

Model: opus-5-5
This commit is contained in:
2026-10-14 09:08:33 +00:00
parent b1eefe0c29
commit c6f325cff5
4 changed files with 90 additions and 10 deletions
+5 -3
View File
@@ -142,9 +142,11 @@ same-origin path `/api/v1/reports`: a random per-browser `clientId` kept in
`localStorage`, `geo` sent as null, and each host's unreported, non-paused
samples (timestamp, latency, error). A per-host high-water mark makes every
report a delta, so only new samples are sent; the mark advances only on a
delivered report, and while paused nothing is sent. Delivery failure is quiet —
one debug-log line per outage, retried at the next interval, never blocking
probing. The report-building step is a pure function of host state.
delivered report, and while paused nothing is sent. Changing the interval clears
each host's history on the page; the samples in it not yet reported still go in
the next report. Delivery failure is quiet — one debug-log line per outage,
retried at the next interval, never blocking probing. The report-building step
is a pure function of host state.
### Backend