Repository navigation
Conversation
compareVersions dropped everything after the first hyphen and compared only the numeric core, so a prerelease and the release cut from it were reported as equal. Anyone installed from the canary dist-tag (0.9.0-canary-...) was never told that 0.9.0 had shipped. Versions are now ordered the way semver orders them: a release outranks any prerelease of the same core, prerelease identifiers are compared per the spec (numeric below alphanumeric, more identifiers above fewer), and build metadata is ignored.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
compareVersionsinpackages/clinow orders versions the way semver does instead of comparing only the numeric core:/n/n- build metadata (+sha...) is ignored;0.9.0>0.9.0-rc.1);0.9.0-rc.1<0.9.0-rc.1.1).Why
The CLI publishes a
canarydist-tag (0.5.14-canary-20261006104237), andchangeset version --snapshot canarycuts the snapshot from the version that is about to be released. A canary install therefore shares its numeric core with the following release. The old comparison dropped everything after the first-, so0.9.0-canary-...compared equal to0.9.0:updateAvailablestayedfalseand the user was never told the release had shipped.The same truncation made
0.9.0-rc.9and0.9.0-rc.10compare equal, and0.9.0+build.5compare greater than0.9.0.How I checked it
vitest run src/__tests__/update-check.test.ts: 15 passed (the 12 existing cases plus 3 new ones). The new cases fail on the currentmaster, where those three pairs compare as0 / 0 / 5instead of>0 / >0 / 0.auth-utils/setup/storage-paths/installer(Windows-only:chmod 0o600, XDG paths,os.homedir()mocks). The passed count goes 334 -> 337, i.e. only the new cases.eslintandprettier --checkclean on both touched files.patchchangeset forctx7.AI assistance
This change was produced with AI assistance (WorkBuddy): the agent wrote the implementation and the tests, and ran the commands quoted above. The author reviewed the diff and the results before submitting.