Skip to content

fix(updater): honor Later reminder cooldown - #602

Open
beruro wants to merge 4 commits into
developfrom
junyu/fix-updater-later-reminder
Open

fix(updater): honor Later reminder cooldown#602
beruro wants to merge 4 commits into
developfrom
junyu/fix-updater-later-reminder

Conversation

@beruro

@beruro beruro commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

Choosing Later only hid the transient install prompt. The next automatic update trigger—startup, interval, foreground, online recovery, or retry—would prepare the already-downloaded update and unconditionally make the prompt visible again.

There was durable state for Skip this version, but no durable, version-scoped state for postponing a reminder.

Solution

  • Persist a per-version reminder deadline for 24 hours when the user chooses Later.
  • Make every automatic update path respect the active reminder deadline.
  • Keep explicit install actions authoritative so a user can reopen the prompt during the cooldown.
  • Remove expired or malformed reminder state before making the next prompt decision.
  • Ensure a reminder for an older version never suppresses a newer release.
  • Clear the current version's reminder when the user skips or installs it.
  • Document the updater state ownership and reminder policy.

The resulting invariant is: automatic preparation may show the install prompt only when the current version has no active reminder deadline.

Potential risks

  • The cooldown uses the system wall clock. A large manual clock change can shorten or extend the effective reminder period.
  • The reminder is stored in localStorage. If localStorage is externally cleared, ORGII will remind again on the next automatic update trigger.
  • A user could postpone installation while an important update is available; the cooldown is intentionally limited to 24 hours, and a newer version bypasses the old reminder.
  • Real updater installation and relaunch were not exercised because they would terminate/restart the running app. Those paths were not changed by this PR.

Audit

Architecture audit covered all 10 layers. Compilation, call-path ownership, naming, default-branch exhaustiveness, persisted JSON shape, production/test entry parity, and resolver symmetry were applicable and passed. Wire/network payload changes, Rust initialization, and cross-domain leakage were not applicable. The audit also replaced ambiguous boolean arguments with a named prompt policy and reduced the automatic test seam to the minimal retry callback.

frontend-ui-audit was intentionally skipped because its methodology excludes single bug-fix PRs and this change does not alter markup, styling, design-system usage, or accessibility behavior.

Area Verdict Evidence Change or reason kept Verification
Background work keep Existing visibility-aware scheduler remains the sole owner of startup/interval/focus/online/retry work No timers or listeners added; all triggers share one reminder policy Scheduler tests plus five-reason reminder matrix
Memory keep One localStorage record containing version + deadline Record is overwritten per Later action and removed when expired/malformed or resolved Persistence, expiry, malformed-state, skip/install tests
Scope/isolation fix Previous transient atom had no durable version scope Reminder is keyed by update version; a newer version is never suppressed New-version regression test
Rendering/hot path keep Existing prompt atom remains the only render gate One synchronous storage read after update preparation; no new subscription AppUpdater behavioral tests

Performance verdict: pass.

Verification

  • npx vitest run src/scaffold/AppUpdater/index.test.ts src/scaffold/AppUpdater/appUpdaterCoordinator.test.ts src/scaffold/AppUpdater/appUpdaterScheduler.test.ts — 34 tests passed
  • npx eslint src/scaffold/AppUpdater/index.tsx src/scaffold/AppUpdater/index.test.ts
  • npm run typecheck
  • git diff --check
  • pre-commit lint-staged and scoped TypeScript checks

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