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

Start logging warnings in v4 when incorrect types are passed in options

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      Use Case

      As a user of the driver
      I want to know when I am passing incorrect option types
      So that I can know if my code actually works as intended

      User Impact

      • Ignoring incorrect option types leads to confused users (e.g., NODE-3650) and potentially silent failures in their production code.

      Dependencies

      • None

      Unknowns

      • The complete list of options that is not strictly validated
      • Do we want to do this for mongo client options or just collection/database api options?

      Acceptance Criteria

      • For every option that is explicitly parsed/transformed from user input (instead of being assigned directly), log a warning if the original option value does not match the expected typescript type
      • Do this for all collection/db api's, including admin
      • Determine whether any client options are affected by this behavior and log warnings there, too, if applicable

      Testing Requirements

      • Add tests to ensure warnings are logged for the expected options

      Documentation Requirements

      • Document the behavior described in NODE-3650 in the 4.x upgrade guide, unless already done by this point; call out any other option types that may be ignored instead of applied.

      Follow Up Requirements

      • File a ticket to start throwing errors instead of just warnings in 5.0

            Assignee:
            Unassigned Unassigned
            Reporter:
            daria.pardue@mongodb.com Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: