Skip to content

fix(ios): a box on UTC keeps its goals on UTC - #136

Merged
frahlg merged 1 commit into
mainfrom
fix/trust-box-utc
Nov 1, 2026
Merged

frahlg merged 1 commit into
mainfrom
fix/trust-box-utc

Conversation

@frahlg

@frahlg frahlg commented Oct 31, 2026

Copy link
Copy Markdown
Member

Problem

Erik (iPhone 16 Pro, app 0.6.3) set his car's goal to 100 % by 17:00 on Sunday 1 November. The car view read "100 % by 17:00 on Sun" with "Next: tomorrow 18:00" under it.

His box runs on UTC. Core plans a goal's clock (ready_by_min, time_of_day_min) on the box's clock, so 17:00 is 17:00 UTC, 18:00 in Stockholm in winter. "Next" shows the box's real deadline. The goal line was the one that was wrong: EVText.householdZone read a box zone of UTC/Etc/UTC as "no zone" and used the phone's clock. The goal and the editor then showed and sent 17:00 on Stockholm's clock, and the box read the same number as UTC. The protocol says readyByMin is in the box's zone.

Change

  • householdZone uses the box's zone whenever it names one, UTC included. It falls back to the phone only for nil, "", Local or a name the phone cannot load. Calendar.household (widgets, savings, grid today) already did this, so the two now agree.
  • When the household clock is UTC and the phone's is not, the goal says 17:00 UTC and the next deadline says Next: tomorrow 17:00 UTC. FTW's clock is set to UTC. (Swedish: Nästa gång: i morgon 17:00 UTC. FTW:s klocka går på UTC.). Both strings live in EV.swift. CarView.swift and CarFirst.swift are untouched; fix(ios): the car's goal on the first screen, and a plan that scrolls #134 is reworking them.

Paired with srcfl/ftw#1945. Core said UTC for some clocks that were not, e.g. a Docker box that mounts the host's /etc/localtime over Debian's Etc/UTC link. That is why the app distrusted UTC. Merge srcfl/ftw#1945 first. Until a box runs that fix, a Docker box with the host's localtime mounted will show its goals and plan times an hour or two off here.

Evidence

  • CarTests.aBoxOnUTCSaysItsGoalIsInUTC is Erik's case: box Etc/UTC, phone Stockholm, time_of_day_min 1020, target_time 2026-11-01T17:00Z. Before the change it fails with 4 issues: the goal reads 17:00 on Sun and next reads 18:00. theHouseholdZoneIsTheBoxsWhenItNamesOne now expects UTC for UTC and Etc/UTC.
  • swift test in appleApp/FTWKit: 636 tests in 95 suites pass locally.
  • Simulator (iPhone 17 Pro, iOS 26.5, demo with the house on UTC by a local patch that is not committed): Now's car row reads "Model Y · 80 % by 07:00 UTC on weekdays".
  • Merges cleanly with fix(ios): a car window on the way says the goal is still ahead #135, which also touches CarTests.swift.

What changes for an owner on a UTC box

Every time in the app (plan text, chart axes, goal) now follows the box's UTC clock. Before, plan times were on the phone's clock and goals were silently an hour or two off. Only the goal lines say "UTC". The fix for the owner is to give the box their zone (TZ), which this PR does not do.

🤖 Generated with Claude Code

The box plans a goal's ready time on its own clock. On a box whose host
names no zone that clock is UTC, so 17:00 is 17:00 UTC, 18:00 in Stockholm
in winter. The app read a box zone of UTC as no zone and showed the goal on
the phone's clock: "100 % by 17:00 on Sun" above "Next: tomorrow 18:00".

The household clock is now the box's whenever it names a zone, UTC
included. When it is UTC and the phone's is not, the goal says "17:00 UTC"
and the next deadline says FTW's clock is set to UTC.

Needs srcfl/ftw's localzone fix, which stops Core saying UTC for a clock
that is not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T15:46:44.157338Z 8f347b3 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 ecf8dd2 into main Nov 1, 2026
1 check passed
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