Skip to content

Match the asset's version the way the tag is parsed - #28

Merged
mxcl merged 1 commit into
mxcl:masterfrom
kageroumado:match-asset-version-tolerantly
Oct 7, 2026
Merged

mxcl merged 1 commit into
mxcl:masterfrom
kageroumado:match-asset-version-tolerantly

Conversation

@kageroumado

Copy link
Copy Markdown
Contributor

Releases are decoded with the tolerant Version parser, so a v1.8 tag becomes 1.8.0. viableAsset(forRepo:) then compared the asset name, as a string, against "<repo>-\(tagName)", which is myapp-1.8.0. An asset named MyApp-1.8.dmg never matched. check() skipped the release without an error, so every installed copy treated it as nonexistent. We shipped two-part versions for a while before noticing that no app had updated.

This parses the version in the asset name with the same tolerant parser and compares it to the tag as a Version:

  • MyApp-2.1.dmg on v2.1 matches. Before this change it did not.
  • MyApp-2.1.0.dmg on v2.1.0 matches, as before.
  • MyApp-2.1.1.dmg on v2.1 still does not match. A test covers this.
  • OtherApp-2.0.0.dmg still does not match.

The release(...) test helper now decodes with .tolerant, the way fetchReleases does, so it can build a v2.1 tag. Its other cases behave the same. The README sentence about asset names now mentions the short form.

swift test: 83 tests pass. The new short-version test fails on master.

🤖 Generated with Claude Code

A v1.8 tag decodes tolerantly to 1.8.0, and the asset was compared against
"<repo>-1.8.0", so MyApp-1.8.dmg never matched. The release was skipped
without an error, and every installed app treated it as nonexistent.
Parse the version in the asset name with the same tolerant parser and
compare versions instead of strings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mxcl
mxcl requested a balanced review from Copilot October 7, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Lowercasing the asset version breaks matching for case-sensitive prerelease identifiers.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Aligns asset-version matching with tolerant release-tag parsing.

Changes:

  • Parses asset versions before comparison.
  • Adds short-version and mismatch tests.
  • Documents short-form asset names.
File Description
AppUpdater.swift Matches parsed asset and tag versions.
Tests/​AppUpdaterTests/​AppUpdaterTests.swift Adds regression coverage and tolerant decoding.
README.md Documents short-version asset names.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AppUpdater.swift
@mxcl
mxcl merged commit 662fcb2 into mxcl:master Oct 7, 2026
1 check passed
kageroumado added a commit to kageroumado/phosphene that referenced this pull request Oct 7, 2026
A v1.8 tag decodes to 1.8.0, and AppUpdater 4.2.0 compared the asset name
against "phosphene-1.8.0", so Phosphene-1.8.dmg was skipped without an
error. 4.2.1 (mxcl/AppUpdater#28, #29) parses the asset's version the way
it parses the tag.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
kageroumado added a commit to kageroumado/adrafinil that referenced this pull request Oct 7, 2026
AppUpdater 4.2.0 decoded a v1.9 tag as 1.9.0 and compared the asset name
against "adrafinil-1.9.0", so Adrafinil-1.9.dmg was skipped without an
error. 4.2.1 (mxcl/AppUpdater#28, #29) parses the asset's version the way
it parses the tag. Tracking the resolved file pins the updater a release
is built with.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

3 participants