[COMPASS-290] Make sure all version comparisons use semver Created: 07/Nov/16  Updated: 10/Jan/24  Resolved: 13/Nov/19

Status: Closed
Project: Compass
Component/s: Stability
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Thomas Rueckstiess Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: COMPASS-2228
Story Points: 3

 Description   

For server version comparisons (e.g. all 3.4-only features) we should use a library that can handle version numbers correctly, e.g. the "semver" package.

Otherwise, we might run into issues with release candidates or other unusual version strings.

Simple string comparison fails in these cases:

> '3.4.0' > '3.4.0-rc3'
false

But semver can handle this correctly:

> semver.gt('3.4.0', '3.4.0-rc3')
true

One place where this happens:

https://github.com/10gen/compass/blob/d244de57b322ae4b3142c13220dec5191fafe0b9/src/internal-packages/crud/lib/component/editable-value.jsx#L73

Need to find all other places where we use simple string comparisons for versions.


Generated at Wed Feb 07 22:24:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.