compareObjectId should have the same behavior in web and node versions

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Not Needed
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a... js-bson developer
      I want... compareObjectId to behave the same for web and node versions
      So that... I don't have to split the codebase around compareObjectId

      User Experience

      • Both the web and node versions of compareObjectId throw identical exceptions to identical wrong input
      • The node version converts the inputs to buffers and throws if the conversion fails, while the web version returns 0 when the inputs are not valid buffers, this behavior needs to change

      Dependencies

      • None

      Risks/Unknowns

      • This is introducing exceptions in code that didn't have them before
      • But this also standardizes exceptions

      Acceptance Criteria

      Implementation Requirements

      • Same inputs into both web and node versions of compareObjectId results in the same result: integer output or thrown exception

      Testing Requirements

      • Tests are passing

      Documentation Requirements

      • Verify that the documentation on the ByteUtils is correct wrt errors

      Follow Up Requirements

      • None

            Assignee:
            Unassigned
            Reporter:
            Pavel Safronov
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: