Sylius: New version notification does not compare versions correctly

Created on 18 May 2018  ·  7Comments  ·  Source: Sylius/Sylius

| Q | A
| ---------------- | -----
| Bug report? | yes
| Feature request? | no
| BC Break report? | no
| RFC? | no
| Sylius version | 1.x

https://github.com/Sylius/Sylius/blob/v1.1.5/src/Sylius/Bundle/AdminBundle/Resources/private/js/sylius-notification.js#L94

It can be solved by using https://www.npmjs.com/package/semver to perform the version comparison.

I have not submitted a PR because Sylius does not have a module bundling / loading system in place yet.

Bug

All 7 comments

Why isn't it correct?

Versions should be compared by semver rules.

In which cases does it give an incorrect result?

For example, 1.1.6-DEV > 1.1.5

@pamil Now, when you've tagged a pre-release version (1.2.0-BETA), it also screws up the update notification for all existing installations. :stuck_out_tongue:

semver.satisfies('1.2.0-BETA', '^1.1.6');
// false

semver.satisfies('1.2.0', '^1.1.6');
// true

But if we want a quick fix, we could use https://github.com/composer/semver and do an AJAX call. WDYT? Personally I'd prefer if we wait to fix it the proper way, since this is not a serious bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mezoni picture mezoni  ·  3Comments

crbelaus picture crbelaus  ·  3Comments

inssein picture inssein  ·  3Comments

igormukhingmailcom picture igormukhingmailcom  ·  3Comments

eb22fbb4 picture eb22fbb4  ·  3Comments