Skip to content

feat(update): disable real updates in make run dev builds#12

Merged
BlackHole1 merged 1 commit into
mainfrom
disable-update-dev
Jun 12, 2026
Merged

feat(update): disable real updates in make run dev builds#12
BlackHole1 merged 1 commit into
mainfrom
disable-update-dev

Conversation

@BlackHole1

Copy link
Copy Markdown
Member

A make run build is always versioned 0.0.0-development, so every update check against the shipped production feed would "find" the newest stable release and could download and install it over the build under test. Sparkle is therefore never started in a bare dev build: no scheduled check fires and the production feed is never contacted. A manual "Check for Updates…" stays available but surfaces a "disabled in development" notice instead.

The update lab (make update-test-*) is the one exception: it redirects the feed to a loopback server via LOCKIME_UPDATE_FEED, so the presence of that env var distinguishes the lab from a plain run and keeps its real download/install flow working. All new code is under #if DEBUG, leaving release builds unchanged.

A `make run` build is always versioned 0.0.0-development, so every
update check against the shipped production feed would "find" the
newest stable release and could download and install it over the
build under test. Sparkle is therefore never started in a bare dev
build: no scheduled check fires and the production feed is never
contacted. A manual "Check for Updates…" stays available but surfaces
a "disabled in development" notice instead.

The update lab (`make update-test-*`) is the one exception: it
redirects the feed to a loopback server via LOCKIME_UPDATE_FEED, so
the presence of that env var distinguishes the lab from a plain run
and keeps its real download/install flow working. All new code is
under #if DEBUG, leaving release builds unchanged.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74c483af-6bd5-4f4e-98c2-69f137204b40

📥 Commits

Reviewing files that changed from the base of the PR and between e9834e8 and 53302ad.

📒 Files selected for processing (3)
  • Sources/LockIME/AppState.swift
  • Sources/LockIME/Localizable.xcstrings
  • Sources/LockIME/Updates/UpdateController.swift

Summary by CodeRabbit

  • Chores
    • Improved development build messaging for update check handling, including informational alerts and localized guidance for testing workflows.

Walkthrough

This PR adds development-build update isolation: when the LOCKIME_UPDATE_FEED environment variable is empty in DEBUG builds, automatic updates are disabled to prevent dev builds from contacting the production feed. A new UpdateCheckOutcome.disabledInDevelopment case signals this state. The controller skips Sparkle initialization but allows manual checks to surface a localized "Development build" alert that directs developers to use lab workflow commands to test the update flow.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title follows the required format and clearly describes the main change: disabling real updates in development builds.
Description check ✅ Passed The pull request description is directly related to the changeset and provides relevant context about why updates are disabled in development builds.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch disable-update-dev

Comment @coderabbitai help to get the list of available commands and usage tips.

@BlackHole1 BlackHole1 merged commit 62cbdcf into main Jun 12, 2026
3 checks passed
@BlackHole1 BlackHole1 deleted the disable-update-dev branch June 12, 2026 11:51
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