fix: refresh Pages viewer once per minute - #38
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82bfa87762
ℹ️ 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".
|
|
||
| const SESSION_KEY = "mac-pulse-private-connection-v1"; | ||
| const REFRESH_INTERVAL_MS = 10_000; | ||
| const REFRESH_INTERVAL_MS = 60_000; |
There was a problem hiding this comment.
Advance heartbeat status between minute polls
With this interval increased to 60 seconds, the server-supplied age_seconds and overall values rendered by render() remain frozen until the next request. If a heartbeat is missed shortly after a successful refresh, the viewer can continue showing “Awake & protected” for nearly a minute after the 90-second offline threshold has passed, whereas the previous delay was at most about ten seconds. Keep the network polling at one minute but advance the displayed age and derive stale/offline state locally between polls.
Useful? React with 👍 / 👎.
Summary
Why
The public GitHub Pages app defaults to synthetic demo readings. The observed 85 percent value was not a sensor reading; the current Mac health check reports 100 percent. The stronger label prevents synthetic values from being mistaken for live telemetry.
Verification