Topology comparison bug processId long type detection incorrectly reuses the same value

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • 2
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      server_description.ts has the following incorrect code which results in incorrect server version comparison whenever the second input's counter is of type Long, note the `rhsCounter` definition.

      if (lhs.processId.equals(rhs.processId)) {
          // tests mock counter as just number, but in a real situation counter should always be a Long
          const lhsCounter = Long.isLong(lhs.counter) ? lhs.counter : Long.fromNumber(lhs.counter);
          const rhsCounter = Long.isLong(rhs.counter) ? lhs.counter : Long.fromNumber(rhs.counter);
          return lhsCounter.compare(rhsCounter);
        }
      

              Assignee:
              Neal Beeken
              Reporter:
              Daria Pardue
              Daria Pardue
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: