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

Command monitoring event constructors cannot handle commands/documents with constructor or __proto__ keys

      At the time of writing, our CommandStartedEvent, CommandFailedEvent and CommandSucceededEvent classes make use of our deepCopy helper function. This helper throws type errors when passed in documents with a constructor key that doesn't have a name field. In addition, when passed in a document with a __proto__ key it will set the object's prototype to the value of that key. This limits the capabilities of our Command Monitoring functionality.

      Use Case

      As a... driver engineer
      I want... _Command Monitoring Events to handle objects with constructor and __proto__ keys
      So that...the driver doesn't crash when command monitoring is enabled

      User Impact

      • At least one customer (HELP-48067)

      Dependencies

      • N/A

      Unknowns

      • Should we eliminate deepCopy entirely?

      Acceptance Criteria

      Implementation Requirements

      • Refactor the aforementioned Command Monitoring events to be able to handle commands/documents with constructor and __proto__ keys

      Testing Requirements

      • Unit tests for the constructors of each command monitoring event to ensure that they do not throw an error when passed in documents with constructor and __proto__ keys

      Documentation Requirements

      • Release note about change in behaviour of Command Monitoring Event constructors

      Follow Up Requirements

      • additional tickets to file, required releases, etc

            Assignee:
            Unassigned Unassigned
            Reporter:
            warren.james@mongodb.com Warren James
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: