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

Write concern parameter loose

    • 1
    • 2
    • Not Needed
    • Not Needed

      Use Case

      I found out loosing write-concern context while using `timeoutMS` option.

      `WriteConcern.fromOptions` static method accepts 3 options formats:

      • `WriteConcernOptions` object
      • `WriteConcern` instance
      • `W` type

      But in case of using `timeoutMS` options, utils function `resolveOptions` calls ([link to code](https://github.com/mongodb/node-mongodb-native/blob/main/src/utils.ts#L533)) `WriteConcern.fromOptions` with options, which looks like `WriteConcern` instance, but it not has instance and more look like `WriteConcernSettings` type:

      writeConcern = WriteConcern.fromOptions({
        ...writeConcern,           
        wtimeout: undefined,           
        wtimeoutMS: undefined         
      }); 

      User Experience

      • What is the desired/expected outcome for the user once this ticket is implemented?
      • If bug: What is the number of impacted customers? How severe is the impact? Is anyone blocked or broken?

      Dependencies

      • upstream and/or downstream requirements and timelines to bear in mind

      Risks/Unknowns

      • What could go wrong while implementing this change? (e.g., performance, inadvertent behavioral changes in adjacent functionality, existing tech debt, etc)
      • Is there an opportunity for better cross-driver alignment or testing in this area?
      • Is there an opportunity to improve existing documentation on this subject?

      Acceptance Criteria

      Implementation Requirements

      • functional reqs, potential snafus to avoid, performance targets, etc

      Testing Requirements

      • unit test, spec test sync, etc

      Documentation Requirements

      • DOCSP ticket, API docs, etc

      Follow Up Requirements

      • additional tickets to file, required releases, etc
      • if node behavior differs/will differ from other drivers, confirm with dbx devs what standard to aim for and what plan, if any, exists to reconcile the diverging behavior moving forward

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            sp.logvin@gmail.com Stepan L
            Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: