Skip to content

Handle invalid package versions and compare complete semver - #450

Merged
mariotaku merged 1 commit into
mainfrom
fix/package-version-handling
Oct 24, 2026
Merged

mariotaku merged 1 commit into
mainfrom
fix/package-version-handling

Conversation

@mariotaku

@mariotaku mariotaku commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

PackageManifest.hasUpdate() could throw for installed versions such as 1.2 or unknown, and for empty/non-string repository metadata. It also split valid dotted prerelease/build metadata as though it were a legacy fourth version component.

Validate full semver before using the exact four-component legacy fallback. Unsupported input returns the existing unknown (null) result; incomplete versions are not coerced or guessed. Preserve numeric/lexical legacy suffix comparisons and the missing-installed-version result.

Concrete ordering corrections:

  • Latest 1.2.3+build.2 versus installed 1.2.3+build.1 now returns false: build metadata does not establish a newer version.
  • Latest 1.2.3-beta.2.2 versus installed 1.2.3-beta.2.1 now returns true, comparing the complete prerelease identifiers.

Validation:

  • 54 public comparator cases cover invalid/runtime non-string values on both sides, missing input, normal newer/equal/older semver, prerelease/build metadata, numeric and string legacy suffixes, and three-/four-component comparisons.
  • Original production comparator: 26 behavioral failures / 28 passes. Fixed comparator: 54/54 focused tests pass.
  • npm test: 176 tests passed across 15 files.
  • npm run ng -- build --configuration=development: passed (existing browser-support/Sass warnings).
  • git diff --check: passed.

No UI changes or live repository/TV test; comparisons were exercised directly with representative metadata fixtures.

Integration validation: #449, #450, and #451 apply together without conflicts; all 213 combined headless tests pass. A current public repository snapshot with 56 packages passes the combined page validation and same-version comparison checks.

@mariotaku
mariotaku merged commit 70823a1 into main Oct 24, 2026
8 checks passed
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