Binary.fromPackedBits does not print out the padding field

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.5.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS: Any
      node.js / npm versions: 2.5.0
      Additional info:
    • 1
    • Iteration Zenith
    • Not Needed
    • Developer Tools

      Problem Statement/Rationale

      What is going wrong? What action would you like the Engineering team to take?

      The padding information is not rendered in the shell's representation of the packed bits vector. Which if reconstructed will change the intended bit length of the vector.

      Steps to Reproduce

      How could an engineer replicate the issue you’re reporting?

      Enterprise test> db.coll.insertOne({ b: Binary.fromPackedBits(new Uint8Array([0b1111_1111]), 7) })
      {
        acknowledged: true,
        insertedId: ObjectId('67f7fed137a914fcd571e27f')
      }
      Enterprise test> db.coll.findOne({ _id: ObjectId('67f7fed137a914fcd571e27f') })
      {
        _id: ObjectId('67f7fed137a914fcd571e27f'),
        b: Binary.fromPackedBits(new Uint8Array([ 255 ])) // No padding information
      }
      

      Expected Results

      What do you expect to happen?

      {
        _id: ObjectId('67f7fed137a914fcd571e27f'),
        b: Binary.fromPackedBits(new Uint8Array([ 255 ]), 7)
      }
      

      Actual Results

      What do you observe is happening?

      Padding argument missing from the fromPackedBits call, which padding defaults to 0 it doesn't throw or warn that its been changed.

      Additional Notes

      Any additional information that may be useful to include.

            Assignee:
            Anna Henningsen
            Reporter:
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: