Skip to content

Log the zone each clock-sync stamp was written in - #82

Merged
QuiteYellow merged 1 commit into
mainfrom
fix/log-the-clock-sync-zone
Sep 8, 2026
Merged

Log the zone each clock-sync stamp was written in#82
QuiteYellow merged 1 commit into
mainfrom
fix/log-the-clock-sync-zone

Conversation

@QuiteYellow

Copy link
Copy Markdown
Owner

ClockSyncTask writes a wall clock with no offset, because that is what the appliance takes. The stamp alone therefore cannot show which zone produced it, and a container with no TZ set falls back to UTC and writes a panel an hour behind for as long as summer time is in force. The appliance answers 2.04 either way, and the plausibility gate cannot catch it because a UTC timestamp is perfectly plausible.

My own bridge had been doing this since the feature shipped. The oven's panel was an hour behind, and separating "the clock sync wrote the wrong time" from "the appliance is drifting on its own" took a docker exec into the container, because the log line showed only the stamp:

clock sync (periodic) /configuration/vs/0 = 2026-09-08T18:24:06 -> 2.04

It now carries the zone, which makes the same line answer the question on its own:

clock sync (periodic) /configuration/vs/0 = 2026-09-08T20:04:41 BST -> 2.04

zone_name resolves the zone of the stamp rather than the host's current one, so an injected now_fn stays consistent with what gets logged, and it falls back to time.tzname where a local zone cannot be resolved: a log line has no business taking the sync down with it. The skip warning on the plausibility gate gets the same treatment, since a zone fault is one way to land outside the window.

.env.example carried TZ already and said what it was for. It now says what leaving it unset costs.

No library change, and no change to what goes on the wire. Demo bridge and its tests only.

Tested: deployed to my Unraid bridge and recreated the container, which is what an env_file change needs. Both appliances reconnected clean, and the first sync of the session wrote BST to the oven and moved the panel. 761 tests pass, check_share_safety.py --changed-since main clean.

https://claude.ai/code/session_01UJBUFo8zZWrebGqf6gUzcL

The appliance takes a wall clock with no offset, so the stamp alone
cannot show which zone produced it. A container with no TZ set falls
back to UTC, writes a panel an hour behind for as long as summer time is
in force, and gets 2.04 for it. My own bridge did exactly that, and
finding out why took a docker exec into the container rather than a look
at the log. The plausibility gate cannot catch it either, since a UTC
timestamp is perfectly plausible.

zone_name resolves the zone of the stamp rather than the host's current
one, so an injected now_fn stays consistent with what gets logged. It
falls back to time.tzname where a local zone cannot be resolved, because
a log line has no business taking the sync down with it.

.env.example carried TZ already and said what it was for. It now says
what leaving it unset costs, since the write succeeds either way and
nothing about it looks wrong.

Claude-Session: https://claude.ai/code/session_01UJBUFo8zZWrebGqf6gUzcL
@QuiteYellow
QuiteYellow merged commit 15dbe72 into main Sep 8, 2026
8 checks passed
@QuiteYellow
QuiteYellow deleted the fix/log-the-clock-sync-zone branch September 8, 2026 19:11
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