Skip to content

fix: invert isVersionStandard superset check so numeric versions pass#314

Merged
MarshallOfSound merged 1 commit into
mainfrom
sam/fix-is-version-standard
May 3, 2026
Merged

fix: invert isVersionStandard superset check so numeric versions pass#314
MarshallOfSound merged 1 commit into
mainfrom
sam/fix-is-version-standard

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Collaborator

isVersionStandard was OR'ing the result of [decimalDigits isSupersetOfSet:partChars] into versionBad without negation — so an all-digit part marked the version as bad. isVersionStandard(@"1.2.3") returned NO; isVersionStandard(@"a.b.c") returned YES.

Effect: any app with ElectronSquirrelPreventDowngrades enabled fails every update at the 'is not a valid version string' check for normal versions, never reaching the actual downgrade comparison.

This went unnoticed because the existing tests only cover +isVersionAllowedForUpdate:from: (the comparison), not the format gate in front of it.

Also rejects empty parts ("1..3") — the empty set is trivially a subset of digits, so it would otherwise slip through after the negation fix.

Adds direct unit coverage for isVersionStandard.

@MarshallOfSound MarshallOfSound enabled auto-merge (squash) May 3, 2026 10:50
isVersionStandard was OR'ing the result of [decimalDigits isSupersetOfSet:partChars]
into versionBad without negation, so an all-digit part marked the version as bad.
Any app with ElectronSquirrelPreventDowngrades=YES would fail every update at the
'is not a valid version string' check for normal versions like '1.2.3', making the
downgrade comparison unreachable.

Also reject empty parts ('1..3') since the empty set is trivially a subset of digits.

Adds direct unit coverage for isVersionStandard — previously only
isVersionAllowedForUpdate:from: was tested.
@MarshallOfSound MarshallOfSound force-pushed the sam/fix-is-version-standard branch from 1f08091 to a59c6f6 Compare May 3, 2026 21:55
@MarshallOfSound MarshallOfSound merged commit 84f2a72 into main May 3, 2026
9 checks passed
@MarshallOfSound MarshallOfSound deleted the sam/fix-is-version-standard branch May 3, 2026 22:13
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