Repository navigation
fix(ios): live through FTW Cloud, the fastest live path wins, and the house is not called by its meter - #28
Conversation
…d by its meter On 0.3.0 through FTW Cloud every node said "Not live, just now", Now showed a clock as if waiting, and the flow stood still. NodeFreshness.live knew only the relay and WebRTC. It now counts the cloud too, and a node read through the cloud is never fresher than the cloud's own grade for its field: anchored and inside the age rules. That grade is the one the band already uses. The house's line said "Live · sungrow": the box reads the house from the meter driver, and the line named that driver as if it were the house. The house now shows no source name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc542b69e8
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| guard carrier == .cloud, let cap = cloudGrade(fid: fid), cap > f.srcState else { return f } | ||
| return NodeFreshness(carrier: f.carrier, srcState: cap, ageMs: f.ageMs, sourceName: f.sourceName) |
There was a problem hiding this comment.
Do not let relay silence downgrade live cloud readings
When the relay has delivered at least one frame and then goes quiet for more than three seconds while FTW Cloud continues delivering live data, sinceLastFrameMs is calculated from shown.relayFrameAtMs, so NodeFreshness.of has already changed an otherwise-live cloud source to .lagging. This guard only applies the cloud grade when it is worse than that state, so a .live cloud grade cannot restore the node; the nodes again appear not live and the flow stops animating during the exact relay-failure scenario that the cloud path should cover. Cloud-backed freshness needs to derive its state from the field's cloud grade without applying the relay silence penalty.
Useful? React with 👍 / 👎.
readingSource() took FTW Cloud whenever its copy was live, and kept it once chosen, so with both paths up Now ran at the cloud's pace: every 5 s while the box did not hear a phone was looking, and at best once a second. The box session's live stream now wins whenever it is live. FTW Cloud gives the first frame before that stream is up and carries on at once when it drops. Fredrik's rule: the path does not matter, only that it is fast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fredrik ran 0.3.0 on his iPhone with FTW Cloud on and saw three faults:
1. A reading through FTW Cloud is live.
NodeFreshness.livecounted only the relay and WebRTC. #19 added FTW Cloud, and the band at the top took it in, but the nodes did not. Now a node read through the cloud counts as live. It is never fresher than the cloud's own grade for its field (SiteModel.cloudGrade), which needs an anchor and keeps to the age rules, the same rules the band uses.2. The fastest live path wins.
readingSource()took FTW Cloud whenever its copy was live, and kept it once chosen. Now therefore ran at the cloud's pace: at best once a second, and every 5 s whenever the box had not heard that a phone was looking. The box session's live stream now wins whenever it is live. FTW Cloud gives the first frame before that stream is up, and takes over at once when it drops. Fredrik's rule: the path does not matter, only that it is fast.3. The house's status line no longer names its source. It said "Live · sungrow" because the box reads the house from the meter driver.
Tests
drop().swift testpasses.Still open: while Fredrik had the app open, the box sent to the cloud only every 5–6 s, so the watch did not seem to reach it. I'm following that up separately.
🤖 Generated with Claude Code