Add periodic background update checks#182
Conversation
SDSLeon
commented
Jun 15, 2026
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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 👍 / 👎.