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

Handle unsupported option "readConcern" in new url parser

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • next
    • Affects Version/s: None
    • Component/s: Core, Native
    • None

      Unlike the legacy uri parser, the spec-compliant uri parser does not filter out unsupported options from the uri string. In a particular case, users can specify the invalid option readConcern (should be readConcernLevel), and unintentionally overwrite our internal representation of a readConcern, leading to failed reads.

      We should come up with a way to ensure this does not happen. Options include:

      1. console.warn when users do this. If we get a readConcern in the parsed options, we warn them that it’s not a supported option, and tell users to use readConcernLevel instead
      2. try to run JSON.parse on the passed-in readConcern, and if it passes + returns an object, use it. otherwise, assume user meant readConcernLevel
      3. Treat readConcern as readConcernLevel, with readConcernLevel taking precedence.

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: