Skip to content

fix(support): read the clock after the week in the help report - #2044

Merged
frahlg merged 1 commit into
masterfrom
2043-support-report-clock
Nov 17, 2026
Merged

frahlg merged 1 commit into
masterfrom
2043-support-report-clock

Conversation

@frahlg

@frahlg frahlg commented Nov 17, 2026

Copy link
Copy Markdown
Member

Problem

A v0.164.0-beta.1 support file attached to #2043 has two contradictions. The help report's Command feedback says the battery and the charger are no_contact / readings_lost, readings_fresh: false. Its Devices table says "Last reading: -58 s ago". The control journal and loadpoints.json in the same zip show both drivers as following, with fresh readings.

handleSupportDump read the clock and then loaded the week. That load has a 60 s budget and takes most of it on a Raspberry Pi. The live sections then used the old clock. A reading that arrived meanwhile was newer than that clock. controlFeedback treats such a reading as not fresh (!rd.UpdatedAt.After(now)), so the report raised an alarm for a healthy device. /api/support/report had the same order.

Change

  • buildSupportReport reads the week, then reads the clock again for the live sections. Both handlers use it.
  • The dump reads the clock once more before planner.json and loadpoints.json, and the last-hour telemetry window ends at that time.
  • The archive name, file times and generated_at keep the start time. So generated_at can differ from the report's "Generated" line by up to the week's load time.

This does not touch #2043's other questions: the brief Pixii gaps, the sign-floor warnings, and the idle plan.

Tests

  • New TestSupportReportReadsTheClockAfterTheWeek gives the week a clock 58 s before the live one.
    • Without the fix it fails with | meter | ok | -58 s ago |, the line in the user's file.
    • Feeding the live sections the week's clock makes it fail too.
  • make verify: pass.
  • go test ./internal/api/: pass.
  • go test -race ./internal/api/ -run Support: pass, as run by an independent reviewer.

Gaps in the tests:

  • No test covers the dump handler's own closure.
  • The week window still ends at the first clock read, and its header states that time.

Refs #2043.

🤖 Generated with Claude Code

The support dump and the help report read the clock, then loaded the
week, which may take most of supportWeekBudget on a Raspberry Pi. The
live sections then used the old clock. A reading that arrived meanwhile
was newer than it, so controlFeedback called a healthy driver
no_contact / readings_lost and the Devices table printed "-58 s ago".
A v0.164.0-beta.1 support file in #2043 showed both for drivers the
control journal had as following.

buildSupportReport now reads the week, then the clock again for the
live sections. The dump reads it once more before planner.json and
loadpoints.json. The archive name and manifest keep the start time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T19:17:03.042360Z a7aa23d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit 12dde0f into master Nov 17, 2026
21 checks passed
@frahlg
frahlg deleted the 2043-support-report-clock branch November 17, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant