feat: add ElectronSquirrelPreventDowngrades opt-in flag#305
Closed
MarshallOfSound wants to merge 1 commit into
Closed
feat: add ElectronSquirrelPreventDowngrades opt-in flag#305MarshallOfSound wants to merge 1 commit into
MarshallOfSound wants to merge 1 commit into
Conversation
c81b054 to
7a9582a
Compare
e5641df to
3d7a29f
Compare
3d7a29f to
c3372e4
Compare
7a9582a to
0d46ed1
Compare
c3372e4 to
cef4bab
Compare
0d46ed1 to
0422f0b
Compare
MarshallOfSound
added a commit
that referenced
this pull request
May 3, 2026
…310) Fixes the intermittent `SQRLTerminationListenerSpec` failures the matrix CI surfaced (#305, #306). `launchApplicationAtURL:` returns immediately while the spawned process is still doing its `NSApplication` startup. `-[SQRLTerminationListener waitForTermination]` then calls `runningApplicationsWithBundleIdentifier:` — if the app hasn't checked in with Launch Services yet, that returns an empty array and the signal completes immediately. Both observed failure modes are this same window: - `observedApp == nil` + `completed == YES` from the start (one-instance test) - `completed` going true after only one of two terminates (multi-instance — listener only saw one app at subscribe time) Block in the fixture until `app.finishedLaunching` so every caller (these two specs plus the seven `SKIP_IF_RUNNING_ON_TRAVIS`-tagged `SQRLUpdaterSpec` cases) sees a stable starting state.
[upstream] electron/patches/squirrel.mac/feat_add_ability_to_prevent_version_downgrades.patch When the running app's Info.plist sets ElectronSquirrelPreventDowngrades to true, refuse to install update bundles whose CFBundleShortVersionString is lower than the current version (or where either side is not a simple A.B.C version). Adds unit specs for +isVersionAllowedForUpdate:from:. The end-to-end 'should not update to lower version numbers' / 'not a valid version string' cases require Info.plist mutation on the running host bundle and are covered by Electron's integration suite.
0422f0b to
69a0e8c
Compare
cef4bab to
0674b38
Compare
Collaborator
Author
|
Folded into #312. |
MarshallOfSound
added a commit
that referenced
this pull request
May 3, 2026
Upstreams the remaining `electron/patches/squirrel.mac/` patches into this repo so Electron can eventually drop them. Six commits, **8 files, +537/−51**, **63 → 74 tests**. | Commit | Upstreams | Tests added | |---|---|---| | `feat: SquirrelMacEnableDirectContentsWrite` | `feat_add_new_squirrel_mac_bundle_installation_method_behind_flag` | parent-dir-untouched e2e | | `fix: abort install if app running; resolve target path once` | `fix_abort_installation_attempt_at_the_final_mile_if_the_app_is` + `fix_resolve_target_bundle_path_once_at_start_of_install` | symlink-target rejected, abort-if-running | | `feat: ElectronSquirrelPreventDowngrades` | `feat_add_ability_to_prevent_version_downgrades` | `+isVersionAllowedForUpdate:from:` units | | `refactor: harden ShipIt launch` | `refactor_use_posix_spawn_instead_of_nstask…` + `fix_trigger_shipit_mach_service_after_smjobsubmit…` + `chore_turn_off_launchapplicationaturl_deprecation…` | (existing remote-ShipIt spec exercises new path) | | `refactor: non-deprecated NSKeyedArchiver` | `refactor_use_non-deprecated_nskeyedarchiver_apis` | `SQRLInstallerOwnedBundle` round-trip | | `fix: prune orphaned staged updates` | `fix_clean_up_orphaned_staged_updates_before_downloading_new_update` | unit prune + e2e bounded-count; replaces `xit` | Fixes #124. Fixes #196. Fixes #264. > [!NOTE] > Two adaptations should be backported to Electron's patches: > - `SQRLUpdater.m`: `BOOL launchPrivileged = !targetWritable` in the original `direct-contents-write` patch shadowed the outer var — it was a dead store > - `SQRLInstaller.m`: `runningApplicationsWithBundleIdentifier:` throws on `nil`; guarded it Replaces the stacked #303 / #304 / #305 / #306 / #307 / #309. #302 (strict codesign validation) stays separate — it touches only `SQRLCodeSignature.m`.
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.
Stacked on #304.
Upstreams
feat_add_ability_to_prevent_version_downgrades.patch. Two unit specs for+isVersionAllowedForUpdate:from:. The end-to-end "should not update to lower version" cases are punted — flag is read fromNSRunningApplication.currentApplication's Info.plist, not unit-reachable.Part of upstreaming
electron/patches/squirrel.mac/into this repo.