GitbookIO / nuts

:chestnut: Releases/downloads server with auto-updater and GitHub as a backend
http://nuts.gitbook.com
Apache License 2.0
1.25k stars 298 forks source link

Pre-release version precedence broken (osx) #102

Open salomvary opened 8 years ago

salomvary commented 8 years ago

Given a single released version 1.0.0-alpha.2 and the application running at the same version, I expect the /update/osx/:currentVersion endpoint to return 204 No content. What I get back instead is the same version.

This does not conform Semver 11: "Precedence for two pre-release versions with the same major, minor, and patch version MUST be determined by comparing each dot separated identifier from left to right until a difference is found as follows: identifiers consisting of only digits are compared numerically and identifiers with letters or hyphens are compared lexically in ASCII sort order."

Example: https://gist.github.com/salomvary/25fd60240ea32ce6ac2698430bf56586

ariporad commented 7 years ago

I'm running in to this as well... Does anyone know how I might fix this? Thanks!

halfbyte commented 7 years ago

I believe, the change that broke this is discussed here.

Looks like #100 actually fixes that, so hopefully it's just a matter of time.

EtienneLem commented 7 years ago

It may be a naive (and/or temporary) fix, but missive/nuts@2089abfd1cde67f377fe344e7d8624bd55d55f39 seems to have fixed that for us.

julienma commented 7 years ago

I've cherry-picked https://github.com/missive/nuts/commit/2089abfd1cde67f377fe344e7d8624bd55d55f39 and indeed confirm this fixes the issue of the latest channel update wanted to download itself (e.g. /update/osx/2.0.0-beta pointing to 2.0.0-beta, instead of returning a 204).

However, this introduces a new issue, where a stable version does not take precedence over its channel (e.g. beta) counterpart: /update/channel/stable/osx/2.0.0-beta returns a 204 whereas I was expecting a download of 2.0.0.

If #100 fixes that, then how can we help merging it?

julienma commented 7 years ago

Update: I've tested PR #100, which seems like the exact answer to my scenarios (at least fixes what I've observed looks exactly like #95 and #102).

10n37 commented 2 years ago

Still facing the same problem. semver('1.5.6-beta', '>=1.2.3-beta') returns false 😢