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-alpha1 → 4.1.0-beta1 → 4.1.0-beta2 → 4.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.
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-alpha1→4.1.0-beta1→4.1.0-beta2→4.1.0We 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.0will always evaluate as lower than4.1.0-beta2.I assumed the logic here to follow the semantic versioning spec but it does not.