test(installer): pin 'unparseable version = Config' behavior + document IsNewer limits

This commit is contained in:
Mika Kuns
2026-04-15 09:26:18 +02:00
parent 97fb215ce6
commit b4dc9509cb
2 changed files with 26 additions and 0 deletions

View File

@@ -32,6 +32,13 @@ public sealed class InstallModeDetector
return new DetectedState(InstallerMode.Config, manifest, release, latestVersion);
}
/// <summary>
/// Returns true only when both versions parse as System.Version (major.minor[.build[.revision]])
/// AND latest &gt; current. Semver pre-release tags like "0.2.0-beta" fail to parse and are
/// treated as "not newer" — the user drops into Config mode with no update offered.
/// This is deliberate: offering an update we can't compare is worse than silently skipping it.
/// If the project starts shipping pre-release tags, revisit this.
/// </summary>
private static bool IsNewer(string latest, string current)
{
if (!Version.TryParse(latest, out var lv)) return false;