fix(macos): guard Sparkle updater against empty SUFeedURL in debug builds#30021
fix(macos): guard Sparkle updater against empty SUFeedURL in debug builds#30021lailoo wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a macOS-specific bug where debug builds displayed a confusing "Appcast feed is empty" error dialog when checking for updates. The fix adds a guard check for empty Key changes:
The implementation correctly addresses the root cause: Confidence Score: 5/5
Last reviewed commit: b54afc7 |
nikolasdehor
left a comment
There was a problem hiding this comment.
The Sparkle SUFeedURL guard fix is clean and correct. However, the second commit (chore: fix server-cron.ts heartbeat type error) conflicts with PRs #30048 and #30010 which fix the exact same line differently. #30048's ternary approach is the cleanest because it eliminates false from the union type at the source. Recommend dropping the server-cron.ts commit from this PR and letting #30048 handle it — the Sparkle fix on its own is an easy APPROVE.
|
Thanks @nikolasdehor for the quick and thorough review! Dropped the |
|
This pull request has been automatically marked as stale due to inactivity. |
Summary
Prevent the Sparkle "Appcast feed is empty" error dialog on macOS debug builds by checking
SUFeedURLbefore initializing the Sparkle updater controller.Problem
When the macOS app is packaged with a
.debugbundle ID,scripts/package-mac-app.shintentionally blanksSUFeedURL. However,makeUpdaterController()only checked for.appbundle extension and Developer ID signing — not whether the feed URL was actually set. If a debug-signed build passed the signing check, Sparkle would be initialized with an empty feed URL, causing the error:Closes #29926
Root cause
makeUpdaterController()inMenuBar.swift:458has aguardthat only checksisBundledAppandisDeveloperIDSigned(). When both pass on a debug build,SparkleUpdaterControlleris initialized with an emptySUFeedURL, triggering the Sparkle error dialog.Changes
apps/macos/Sources/OpenClaw/MenuBar.swift— Added aSUFeedURLemptiness check inmakeUpdaterController(): returnsDisabledUpdaterControllerwhen the feed URL is missing or empty, which causes the About screen to show "Updates unavailable in this build." instead of triggering a Sparkle error.apps/macos/Tests/OpenClawIPCTests/UpdaterControllerTests.swift— Added regression tests verifyingDisabledUpdaterControllerreportsisAvailable = false,checkForUpdatesis a no-op, andAboutSettingsrenders correctly with a disabled updater.src/gateway/server-cron.ts— Fixed pre-existing type error:agentEntryhas typefalse | AgentConfigdue to&&short-circuit; replacedagentEntry?.heartbeatwithagentEntry && agentEntry.heartbeatto satisfy TypeScript.Reproduction & verification
Bug confirmed (source analysis on main):
makeUpdaterController()atMenuBar.swift:461only guards on.appextension + Developer ID signingpackage-mac-app.sh:28-30blanksSUFeedURLfor.debugbundle IDsFix verified:
UpdaterControllerTests) 3/3 passed on fix branch:disabledUpdaterReportsUnavailable✅disabledUpdaterCheckIsNoOp✅aboutSettingsShowsUnavailableForDisabledUpdater✅tsgotype check passes (server-cron.ts error resolved)Test plan
UpdaterControllerTests.swift— 3 regression testsEffect on User Experience
Before: Debug builds show a confusing "Appcast feed is empty" Sparkle error dialog when clicking "Check for Updates" in About.
After: Debug builds show a clean "Updates unavailable in this build." message in the About screen, and the update toggle/button are hidden.