Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Version Comparison Result #264

Open
CliftonH opened this issue Jan 19, 2022 · 4 comments
Open

Unexpected Version Comparison Result #264

CliftonH opened this issue Jan 19, 2022 · 4 comments

Comments

@CliftonH
Copy link

We have an electron app which follows a semantic versioning scheme with a prerelease suffix to indicate release channel. Our normal release process might include publishing more than one alpha or beta before being published to GA and might look something like this: alpha1 → beta1 → beta2 → GA

specifically:

4.1.0-alpha14.1.0-beta14.1.0-beta24.1.0

We noticed some strange behavior where under certain conditions the updater would indicate that an update is available and would download the update, but would not restart the application running the updated version. I've tracked it down to this line as the root cause. Essentially, when comparing a version number which has a prerelease suffix with one which does not, the version with the suffix is always considered higher. For example, 4.1.0 will always evaluate as lower than 4.1.0-beta2.

I assumed the logic here to follow the semantic versioning spec but it does not.

@anaisbetts
Copy link

I believe you are correct, but also I want to point out that your versioning scheme is flawed - you cannot use beta1, beta2 etc, the number at the end is not parsed, it's sorted in simple alphabetical order, so e.g. beta2 > beta10, which is probably not what you want

@CliftonH
Copy link
Author

Thanks, Ani, you're totally right. We're in the middle of a large refactor of our versioning/updating pipeline to address this and other issues while following a proper semantic versioning scheme, however this bug will still be an issue for us.

@lockiechen
Copy link

lockiechen commented Mar 30, 2023

@anaisbetts will fix the problem? support semver version spec

@lockiechen
Copy link

@CliftonH how do you resolve the problem?

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

No branches or pull requests

3 participants