Repository navigation
fix(support): read the clock after the week in the help report - #2044
Merged
Merged
Conversation
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]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 andloadpoints.jsonin the same zip show both drivers asfollowing, with fresh readings.handleSupportDumpread 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.controlFeedbacktreats such a reading as not fresh (!rd.UpdatedAt.After(now)), so the report raised an alarm for a healthy device./api/support/reporthad the same order.Change
buildSupportReportreads the week, then reads the clock again for the live sections. Both handlers use it.planner.jsonandloadpoints.json, and the last-hour telemetry window ends at that time.generated_atkeep the start time. Sogenerated_atcan 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
TestSupportReportReadsTheClockAfterTheWeekgives the week a clock 58 s before the live one.| meter | ok | -58 s ago |, the line in the user's file.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:
Refs #2043.
🤖 Generated with Claude Code