Skip to content

fix(ios): live through FTW Cloud, the fastest live path wins, and the house is not called by its meter - #28

Merged
frahlg merged 2 commits into
mainfrom
claude/cloud-is-live
Oct 13, 2026
Merged

frahlg merged 2 commits into
mainfrom
claude/cloud-is-live

Conversation

@frahlg

@frahlg frahlg commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Fredrik ran 0.3.0 on his iPhone with FTW Cloud on and saw three faults:

  • Every node said "Not live, just now", Now showed a clock as if it were waiting, and the flow lines stood still.
  • The figures jumped about every 5 s. With both paths up it felt slower than the relay had alone.
  • The house was called "sungrow".

1. A reading through FTW Cloud is live. NodeFreshness.live counted 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

  • A live reading is live through the relay, WebRTC and the cloud, and never from the cache or with no carrier.
  • With both paths live, the box's stream wins and stays when the cloud fails.
  • When the box session drops, the cloud takes over at once. The test rig's fake relay could not drop before; it now has drop().
  • swift test passes.

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

…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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-13T15:51:58.998598Z fc542b6 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +150 to +151
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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>
@frahlg frahlg changed the title fix(ios): a reading through FTW Cloud is live; the house is not called by its meter fix(ios): live through FTW Cloud, the fastest live path wins, and the house is not called by its meter Oct 13, 2026
@frahlg frahlg mentioned this pull request Oct 13, 2026
@frahlg
frahlg merged commit 2fbb17d into main Oct 13, 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