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

Make sure all version comparisons use semver

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Stability
    • None

    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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: