fix(settings): keep Sparkle from starting in a UI test launch - #2823
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every UI shard on
mainhas been red since #2813. Its own PR run failed the same way, and so did main runs 34741579313, 34748586282 and 34761684412. The last green run was 3bf3025.Root cause
Sparkle's permission prompt took the key window. Before #2813,
UpdaterBridge.initsetautomaticallyChecksForUpdateson every launch. That persistedSUEnableAutomaticChecks, which as a side effect stopped Sparkle from ever asking. #2813 removed the write, asSPUUpdater.hsays to.Info.plistdoes not declare the key either, so on a runner whose defaults are empty, Sparkle asks "Check for updates automatically?" from the app's second launch on (SPUUpdater.m,startUpdateCycle).NSUserDefaults.standardUserDefaults, which the sandbox cannot reach.app.windows.firstMatchthen resolves to the prompt, and typed keys go to it.SUEnableAutomaticChecksset.SoftwareUpdateSettingsUITests, added in #2813, has never passed on CI, for two reasons of its own:testSoftwareUpdateControlsAreOfferedqueriedcheckBoxes, but the grouped Form renders both toggles as switches.testCheckFrequencyOffersDailyAndWeeklyonly passed where automatic checks were already on. On the runner the toggle read off, so the picker was disabled and the click opened nothing.Fix
UpdaterBridgedoes not start Sparkle when storage is isolated (AppStorageEnvironment.isIsolated, true only underTABLEPRO_UI_TEST_SANDBOX). A UI test or docs screenshot launch gets no permission prompt, no scheduled or background check, no download or install, and no write to the real domain. The settings pane still reads Sparkle's values, since those getters do not need a started updater. A shipped build still passesstartingUpdater: true.SoftwareUpdateSettingsUITests:switches;-SUEnableAutomaticChecks YESin the argument domain for the frequency test, which is read first and never persisted, and asserts the picker is enabled before clicking it;testATestLaunchNeverStartsTheUpdater. It asserts Settings' Check for Updates button is disabled, with automatic checks pinned off, so a started updater neither prompts nor begins a check that would also disable the button.No CHANGELOG entry: nothing user-visible changes.
Verification
SoftwareUpdateSettingsUITestscases pass;SoftwareUpdateSettingsUITeststrees showSwitchelements, and aDisabledfrequency picker beside a toggle reading 0.SPUUpdater.mstartUpdateCycle: the prompt condition;SUHost.m: standard defaults for the main bundle, and a stringYESaccepted from the argument domain;SPUUpdater.m: settings getters and setters work on an updater that was never started, andcheckForUpdatesthere only logs.swiftlint lint --stricton both files: 0 violations.Not changed here
SUHasLaunchedBeforeto the real domain. That predates this PR.https://claude.ai/code/session_01373GBhF8GLfq9E4SHffNh4