Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6438

Add Regression test for BSON library - deserializes undefined type to JS undefined

    • 0
    • Not Needed
    • Not Needed
    • 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?

      Use Case

      As a... Node.js engineer
      I want... to catch a mistaken change in the BSON deserialize API
      So that... we do not introduce unintentional changes

      User Experience

      • What is the desired/expected outcome for the user once this ticket is implemented?
        • BSON.deserialize on bytes that contain the deprecated undefined type return JS undefined
      • If bug: What is the number of impacted customers? How severe is the impact? Is anyone blocked or broken?
        • Not a bug

      Dependencies

      • None

      Risks/Unknowns

      • What could go wrong while implementing this change? (e.g., performance, inadvertent behavioral changes in adjacent functionality, existing tech debt, etc)
        • No risk, adding a test to reduce risk
      • Is there an opportunity for better cross-driver alignment or testing in this area?
        • Possibly, deprecated types are generally not useful but when a driver is deployed for the purpose of building a product over MongoDB rather than an application the ability to interact with these legacy types is necessary, so some degree of support should be maintained.
      • Is there an opportunity to improve existing documentation on this subject?
        • Yes, the deserializer returns undefined and the serializer ignores those values by default. The driver however defaults ignoreUndefined to false, so it mitigates that potential surprise.

      Acceptance Criteria

      Implementation Requirements

      • None

      Testing Requirements

      • Add a test to assert JS undefined is returned when BSON contains deprecated undefined
      • Assert ignoreUndefined=false inserts a BSON null for undefined values
        • Organizational: find existing BSON undefined tests and move them to a file of that name.

      Documentation Requirements

      Follow Up Requirements

      • WRITING-15419

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: