Commit 6fdfd16
fix: v0.1.10 wrongly showed as TooOld when only 1 release behind
User screenshot: running v0.1.10, latest v0.1.11, banner says "v0.1.10
is too old (latest v0.1.11). Uploads are blocked until you update."
With StaleThresholdVersions=2 they should have seen the yellow
"slightly stale" banner — one release behind is well inside the
tolerance.
Root cause: System.Version-shape mismatch in the staleness IndexOf.
* Assembly.GetName().Version returns 4-part Version(0,1,10,0)
(Revision=0)
* TryParseTag("v0.1.10") returns 3-part Version(0,1,10)
(Revision=-1, "unset" sentinel)
* List<Version>.IndexOf uses Version.Equals, which compares ALL
FOUR components → 4-part current never matches 3-part released
list → idxInRecent = -1 → fell through to TooOld.
The Compare-against-latest branch worked fine (Version.CompareTo
treats Revision=-1 as < Revision=0 but the Build difference
dominated, so we correctly detected "older"). The IndexOf is the
only place where component-exact equality matters, and that's where
it went wrong.
Fix in two places (defensive at source and consumer):
* UpdateChecker.GetCurrentAssemblyVersion now normalises to
3-part via new NormalizeToThreePart helper.
* UpdateChecker.Compute also normalises both currentVersion and
every element of releasedVersions on entry. Either fix alone
would have closed the bug; doing both means the function is
correct in isolation regardless of how the caller shapes
inputs.
Regression tests:
* Compute_FourPartCurrentVersionStillMatchesThreePartReleased
pins exactly the shape that bit production (4-part current vs
3-part released).
* Compute_FourPartCurrentEqualsThreePartLatest_IsCurrentNotDevBuild
pins a related shape — without normalisation,
Version(0,1,11,0).CompareTo(Version(0,1,11)) > 0 would have
misclassified a fully up-to-date 4-part install as DevBuild.
* NormalizeToThreePart_StripsRevisionAndClampsBuild for the
helper itself, including the 2-part-input edge.
This ships in v0.1.12 (commit goes on top of b33e4d9, both
untagged). Affects every v0.1.8+ install today — the banner has
been showing TooOld whenever the user is 1 or 2 releases behind.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b33e4d9 commit 6fdfd16
2 files changed
Lines changed: 92 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
287 | 296 | | |
288 | 297 | | |
289 | | - | |
| 298 | + | |
290 | 299 | | |
291 | 300 | | |
292 | 301 | | |
| |||
297 | 306 | | |
298 | 307 | | |
299 | 308 | | |
300 | | - | |
| 309 | + | |
| 310 | + | |
301 | 311 | | |
302 | 312 | | |
| 313 | + | |
303 | 314 | | |
304 | 315 | | |
305 | 316 | | |
| |||
321 | 332 | | |
322 | 333 | | |
323 | 334 | | |
324 | | - | |
| 335 | + | |
325 | 336 | | |
326 | 337 | | |
327 | 338 | | |
| |||
337 | 348 | | |
338 | 349 | | |
339 | 350 | | |
| 351 | + | |
| 352 | + | |
340 | 353 | | |
341 | | - | |
| 354 | + | |
342 | 355 | | |
343 | 356 | | |
344 | 357 | | |
| |||
386 | 399 | | |
387 | 400 | | |
388 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
389 | 412 | | |
390 | 413 | | |
391 | 414 | | |
392 | 415 | | |
393 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
394 | 432 | | |
395 | 433 | | |
396 | 434 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
134 | 183 | | |
135 | 184 | | |
136 | 185 | | |
| |||
0 commit comments