Changing the interval drops the samples not yet reported to the backend #124

Closed
opened 2026-10-14 11:00:54 +02:00 by clawbot · 2 comments
Collaborator

The interval menu clears every target's history, and the reporter builds each report from that history. So the samples recorded since the last delivered report, up to a minute of them at the default reportInterval, are never sent, though the backend is reachable.

Where, on next at b1eefe0: src/main.js. The interval menu's handler sets host.history = [] (line 1505); Reporter.flush (line 500) reports only what buildReport (line 436) finds in that history.

How to see it: with the backend running, change the interval about 50 seconds after a report. The next report starts with samples from after the change, and the stored reports have none for the 50 seconds before it. Found by reading the code; not run in a browser.

What is right: README.md, Reporting: every reportInterval the page posts "each host's unreported, non-paused samples". #53: unsent samples are dropped only when a report cannot be delivered and they fall out of the history window.

Severity: medium. Up to a minute of measurements is lost at every interval change.

Definition of done

  • Samples recorded before an interval change and not yet reported are sent, as if the interval had not changed; the page's history still starts over.
  • A unit test records samples, changes the interval, and finds those samples in the next report.
  • TODO.md updated in the same commit; commit title ends (closes #N).

Model: opus-5-5

The interval menu clears every target's history, and the reporter builds each report from that history. So the samples recorded since the last delivered report, up to a minute of them at the default `reportInterval`, are never sent, though the backend is reachable. **Where**, on `next` at `b1eefe0`: `src/main.js`. The interval menu's handler sets `host.history = []` (line 1505); `Reporter.flush` (line 500) reports only what `buildReport` (line 436) finds in that history. **How to see it**: with the backend running, change the interval about 50 seconds after a report. The next report starts with samples from after the change, and the stored reports have none for the 50 seconds before it. Found by reading the code; not run in a browser. **What is right**: `README.md`, Reporting: every `reportInterval` the page posts "each host's unreported, non-paused samples". https://git.eeqj.de/sneak/netwatch/issues/53: unsent samples are dropped only when a report cannot be delivered and they fall out of the history window. **Severity**: medium. Up to a minute of measurements is lost at every interval change. ## Definition of done - [ ] Samples recorded before an interval change and not yet reported are sent, as if the interval had not changed; the page's history still starts over. - [ ] A unit test records samples, changes the interval, and finds those samples in the next report. - [ ] `TODO.md` updated in the same commit; commit title ends ` (closes #N)`. Model: opus-5-5
clawbot self-assigned this 2026-10-14 11:00:54 +02:00
Author
Collaborator

Built in #128: the interval menu now moves each host's history into clearedHistory instead of discarding it, and each report is built from both, so the samples recorded before the change that no report has delivered go in the next one. The page's history still starts over, and the per-host marks keep a delivered sample out of later reports.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/netwatch/pulls/128: the interval menu now moves each host's history into `clearedHistory` instead of discarding it, and each report is built from both, so the samples recorded before the change that no report has delivered go in the next one. The page's history still starts over, and the per-host marks keep a delivered sample out of later reports. Model: opus-5-5
Author
Collaborator

Reproduced in the image built from next at b1eefe0, driven in headless Chrome: the interval was changed 21 seconds after a delivered report, and the stored reports have no samples from the seven rounds between that report and the change.

Model: opus-5-5

Reproduced in the image built from `next` at `b1eefe0`, driven in headless Chrome: the interval was changed 21 seconds after a delivered report, and the stored reports have no samples from the seven rounds between that report and the change. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#124