Skip to content

feat(mac): notify when an update is available - #1283

Merged
iamtoruk merged 1 commit into
mainfrom
feat/update-notification
Sep 10, 2026
Merged

iamtoruk merged 1 commit into
mainfrom
feat/update-notification

Conversation

@iamtoruk

Copy link
Copy Markdown
Member

Closes #1261.

  • The 2-day background poll posts one user notification per new version pair (app, CLI, or both). A UserDefaults stamp dedupes it, so the repoll stays quiet until a newer release.
  • Clicking the notification runs the existing performFullUpdate, the single update path. The app delegate handles willPresent (banner while frontmost) and didReceive.
  • Settings > General gains a "Notify me about updates" toggle, default on. Off means no post and no permission request.
  • Authorization (.alert only) is requested lazily the first time a notification would post, never at launch. Denied means no post; nothing dialogs, nothing blocks the update path.
  • Manual "Check for Updates" does not notify; it already shows its result in an alert.
  • The notification side sits behind an UpdateNotifier protocol. UNUserNotificationCenter.current() aborts outside an app bundle, so tests use a recording stub and never construct the system notifier.

Known: release builds are ad-hoc signed, so macOS may re-ask for notification permission after an update since the signature changes per build. Handled by the denied path; a Developer ID signature is the real fix and is separate.

Tests: 8 new (dedupe, newer version re-notifies, toggle off, three copy cases, authorization denied) on an isolated UserDefaults suite. swift test 450/450, swift build -c release clean.

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.

macOS menubar: post a system notification when an update is available

1 participant