Skip to content

fix: refresh Pages viewer once per minute - #38

Merged
xudaniel merged 1 commit into
mainfrom
codex/pages-60-second-refresh
Aug 22, 2026
Merged

fix: refresh Pages viewer once per minute#38
xudaniel merged 1 commit into
mainfrom
codex/pages-60-second-refresh

Conversation

@xudaniel

Copy link
Copy Markdown
Owner

Summary

  • refresh private API and demo data once every 60 seconds instead of every 10 seconds
  • label the battery card as SYNTHETIC DATA in demo mode and LIVE DATA in connected mode
  • update English and Chinese documentation to match the one-minute heartbeat cadence
  • bump the service-worker cache so existing installations receive the correction

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

  • Pages application tests: 5 passed
  • JavaScript syntax: passed
  • bilingual documentation checks: passed
  • desktop visual rendering: passed
  • exact refresh assertion: 60,000 ms

@xudaniel
xudaniel merged commit 7178ca6 into main Aug 22, 2026
10 checks passed
@xudaniel
xudaniel deleted the codex/pages-60-second-refresh branch August 22, 2026 05:57

@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: 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".

Comment thread pages/app.js

const SESSION_KEY = "mac-pulse-private-connection-v1";
const REFRESH_INTERVAL_MS = 10_000;
const REFRESH_INTERVAL_MS = 60_000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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