Skip to content

Add periodic background update checks#182

Merged
SDSLeon merged 2 commits into
masterfrom
lightcode/daring-kestrel-e230004f
Jun 15, 2026
Merged

Add periodic background update checks#182
SDSLeon merged 2 commits into
masterfrom
lightcode/daring-kestrel-e230004f

Conversation

@SDSLeon

@SDSLeon SDSLeon commented Jun 15, 2026

Copy link
Copy Markdown
Owner
  • Schedule an automatic update check 30 seconds after launch so startup stays responsive while still discovering releases early
  • Poll hourly while the app keeps running so long-lived sessions find new versions without a restart
  • Skip redundant scheduled checks when a check or download is already in progress, and stop polling once an update is downloaded and ready to install
  • Add tests for the initial delay, hourly interval, and idle gating using fake timers and an event-emitting autoUpdater mock

- Delay initial check to 30s and poll hourly while the app runs
- Gate scheduled checks when one is in flight or an update is staged
- Clear the interval before quitAndInstall to avoid races
- Add timer-based tests with an event-emitting electron-updater mock
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
lightcode-landing Skipped Skipped Jun 15, 2026 8:56pm

@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: 4e92caf0ba

ℹ️ 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".

// is never restarted still surfaces new releases (the sidebar install
// affordance reacts to the resulting status).
setTimeout(runScheduledCheck, INITIAL_CHECK_DELAY_MS);
periodicTimer = setInterval(runScheduledCheck, PERIODIC_CHECK_INTERVAL_MS);

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 Suppress background polling error toasts

When the update endpoint is temporarily unreachable (offline laptop, captive portal, flaky GitHub releases), this new hourly interval keeps calling runScheduledCheck; the shared autoUpdater.on("error") handler sends an error status, and the renderer's update handler turns every such status into a danger toast. That means users can get an update-error toast every hour from a background poll they did not initiate, so the scheduled path should either suppress UI error statuses or back off separately from manual checks.

Useful? React with 👍 / 👎.

@SDSLeon SDSLeon merged commit 353d470 into master Jun 15, 2026
6 checks passed
@SDSLeon SDSLeon deleted the lightcode/daring-kestrel-e230004f branch June 15, 2026 20:56
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