Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-290

Make sure all version comparisons use semver

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Stability
    • None

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: