Skip to content

feat(updater): add configurable update delay - #37447

Merged
nwparker merged 5 commits into
mainfrom
nwparker/feature-update-cooldown
Nov 2, 2026
Merged

nwparker merged 5 commits into
mainfrom
nwparker/feature-update-cooldown

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​382 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​370
Prod 24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​860 $\color{#cf222e}{\Huge{\mathbf{−}}}$​204 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​656

Closes #5259.

Adds Settings → General → Updates → Update Delay with None / 1 / 3 / 7 / 14 / 30 days. Orca offers the newest ready release that has cleared the selected delay. None is the default.

The label has an info tooltip: “Wait this many days after a release is published before Orca offers it.” Held releases show their availability time and a Skip Delay Once action. A bypass requested during another check is queued and consumed by the next check.

Release age uses GitHub's Atom entry timestamp. Missing timestamps keep releases held without inventing dates; feed failures retry instead of bypassing the delay through the stable fallback. A fallback tag must have a known timestamp that clears the delay. Background held checks preserve available, downloading, and downloaded updates. Changing the delay during a check queues a fresh check with the saved setting. When all newer releases are held, checks schedule a wakeup when the delay clears, with a five-minute buffer. Explicit perf, pinned-tag, and local-build selections bypass the delay.

The optional held-release status and one-time bypass work through the updater RPC contract. Older clients can continue reading the existing status fields.

Validation:

  • ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2: all 30 gates pass, including the broad related-test run.
  • Focused updater, release-feed, window setup, and settings lifetime tests pass (90 tests).
  • React Doctor changed-lines check passes.
  • Light, dark, and narrow component fixtures rendered and visually checked. These screenshots use real components and store state, without launching Electron or calling the live release feed.

Before (main):

Updates before

After, with the info tooltip open:

Update Delay tooltip

Held release at narrow width:

Held release

nwparker and others added 2 commits November 2, 2026 02:34
…c for N days

Adds an Update Delay setting (None/1/3/7/14/30 days) for supply-chain safety (#5259).
Release age comes from GitHub's Atom feed timestamps and fails closed when unknown.
Settings shows the held release with a countdown, a one-off Skip Delay Once, and
the updater wakes when a held release clears instead of waiting a day.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The updater now supports a configurable minimum release age. It parses release timestamps, withholds releases that do not meet the delay, and reports their availability times. Users can configure the delay in settings or bypass it for one check. Background checks can schedule a follow-up check when a held release approaches availability.

Merge Risk: Low · up to 081cb

A newer held release can be hidden while an older update is available, and it may be offered up to a day late. The change is mergeable with awareness of these bounded update-delay issues.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 13.04% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: adding a configurable update delay to the updater.
Linked Issues check Passed Issue #5259 requests stable updates that have been available for a chosen period. The PR implements the cooldown approach with configurable delays in src/shared/update-delay.ts and the settings UI. …
Out of Scope Changes check Passed The changes remain within issue #5259. The updater, RPC types, settings control, localization, scheduling, release-feed handling, fixtures, and tests directly implement or support the configurable upd…
Description check Passed The description is detailed and covers the user-visible change, motivation, linked issue, visual proof, testing, compatibility behavior, and validation results. It does not use every template heading …
Full details: Linked Issues check

Explanation

Issue #5259 requests stable updates that have been available for a chosen period. The PR implements the cooldown approach with configurable delays in src/shared/update-delay.ts and the settings UI. src/main/updater-release-delay.ts uses known Atom timestamps, holds releases with unknown or insufficient age, and computes the availability time. The updater supports held-release status, wake scheduling, and one-time bypass. The PR also adds focused automated tests for delay behavior, feed failure handling, bypass behavior, scheduling, and settings changes. The Canary/Stable alternative is not required because the issue presents it as an alternative approach.

Full details: Out of Scope Changes check

Explanation

The changes remain within issue #5259. The updater, RPC types, settings control, localization, scheduling, release-feed handling, fixtures, and tests directly implement or support the configurable update cooldown. The release-readiness checks support safe release selection within that updater flow. No unrelated product behavior is demonstrated.

Full details: Description check

Explanation

The description is detailed and covers the user-visible change, motivation, linked issue, visual proof, testing, compatibility behavior, and validation results. It does not use every template heading and does not explicitly state risk, rollback steps, AI disclosure, or checklist completion, but the core required information is present.

Full details: Docstring Coverage

Explanation

Docstring coverage is 13.04% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 23 functions across 27 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Comment thread src/main/updater-release-delay.ts Resolved
@nwparker nwparker changed the title feat(updater): Update Delay — wait N days before offering a release feat(updater): add configurable update delay Nov 2, 2026

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Follow-up Comments

Outside diff Held background checks can replace downloaded, downloading, or available status with not-available.

93-93: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Held background checks can replace downloaded, downloading, or available status with not-available.

runBackgroundUpdateCheck does not check whether an update is already available, downloading, or downloaded. When the preflight returns 'not-available', it calls settleHeldUpdateCheck. That method sends { state: 'not-available', userInitiated } without a status check, which can overwrite the ready-update state.

A possible sequence:

  1. A user selects Skip Delay Once while a release is held. That check downloads the release.
  2. A later automatic check pins the feed with the delay active again. The release is still too new, so the preflight returns 'not-available'.
  3. settleHeldUpdateCheck sends not-available with the held-release details. The status can replace the completed download with the "on hold" state, which hides the install action.

The earlier silent background path sent no status in this state unless a nudge was pending. The new path sends one every time.

Skip the status send when the state is available, downloading, or downloaded. Place the guard after completeSilentUpdateCheck and scheduleCheckWhenDelayedUpdateClears, so check completion and rescheduling still run:

Suggested fix
     this.completeSilentUpdateCheck(userInitiated)
     this.scheduleCheckWhenDelayedUpdateClears()
+    const { state } = this.currentStatus
+    if (state === 'available' || state === 'downloading' || state === 'downloaded') {
+      return
+    }
     this.sendSettledCheckStatus({ state: 'not-available', userInitiated })

Open the source location

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Follow-up Comments

Outside diff Schedule a wake check when an older release is eligible.

92-94: Minor · Functional Correctness · Quick win

Schedule a wake check when an older release is eligible.

If the feed finds an eligible older release and a newer held release, preflight returns ready. This branch launches electron-updater, so settleHeldUpdateCheck() never schedules the held release’s wake check. The update-available handler schedules a daily check instead. As a result, Orca can offer the newer release almost a day after its delay clears. Keep the held release’s wake time when scheduling the next check, including after a ready result. (raw.githubusercontent.com)

Open the source location

Outside diff Preserve held-release metadata across the release lifecycle.

94-98: Minor · Functional Correctness · Quick win

Preserve held-release metadata across the release lifecycle.

When this.delayedUpdate is set and the older release is available, downloading, or downloaded, decorateStatusWithDelayedUpdate currently drops it. statusesEqual also ignores changes to that metadata. Settings then cannot keep the held-release panel visible.

Carry delayedUpdate through not-available, available, downloading, and downloaded, include it in comparisons for those states, and read it from each of them in UpdateDelaySetting. Keep Skip Delay Once usable for not-available and available, but hide or disable it during downloading and downloaded so it cannot replace an active or completed download. Keep the existing available text that describes the older downloadable release; do not replace it with “You’re up to date.”

Open the source location

Nitpick Cover the queued ignoreUpdateDelay: false case with a nonzero saved delay.

206-243: Trivial · Functional Correctness · Quick win

Cover the queued ignoreUpdateDelay: false case with a nonzero saved delay.

The current false case changes the saved delay to zero. Therefore, it cannot detect a regression that treats false as true. Keep the zero-day case and add a seven-day case that asserts minReleaseAgeMs.

Suggested fix
-  it.each([true, false])(
-    'queues explicit delay choice %s while another check is in flight',
-    async (ignoreUpdateDelay) => {
+  it.each([
+    [true, 7],
+    [false, 0],
+    [false, 7],
+  ])(
+    'queues explicit delay choice %s with saved delay %s while another check is in flight',
+    async (ignoreUpdateDelay, savedDelayDays) => {
       const firstFeed = Promise.withResolvers<unknown>()
       fetchNewerReleaseTagsMock.mockReturnValueOnce(firstFeed.promise).mockResolvedValue(['v1.4.3'])
       const { setupAutoUpdater, checkForUpdatesFromMenu } = await loadUpdaterModule()
       let delayDays = 7
@@
       checkForUpdatesFromMenu()
       if (!ignoreUpdateDelay) {
-        delayDays = 0
+        delayDays = savedDelayDays
       }
       checkForUpdatesFromMenu({ ignoreUpdateDelay })
@@
-      expect(fetchNewerReleaseTagsMock).toHaveBeenLastCalledWith('1.4.1', 1, {
-        includePrerelease: false
-      })
+      expect(fetchNewerReleaseTagsMock).toHaveBeenLastCalledWith(
+        '1.4.1',
+        1,
+        ignoreUpdateDelay || savedDelayDays === 0
+          ? { includePrerelease: false }
+          : expect.objectContaining({
+              includePrerelease: false,
+              minReleaseAgeMs: savedDelayDays * DAY_MS
+            })
+      )

Open the source location


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eeca7adf-9b25-49ef-a10d-439e08a2ec97
Commits

Reviewing files that changed from the base of the PR and between 5b0c9ad and 081cb7b.

Files selected for processing: 6
  • src/main/updater.update-delay.test.ts
  • src/main/updater/updater-check-state.ts
  • src/main/updater/updater-menu-checks.ts
  • src/main/updater/updater-scheduling.ts
  • src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx
  • src/renderer/src/components/settings/UpdateDelaySetting.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

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.

[Feature]: Update Cooldown

1 participant