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

Properly filter options passed to connection.command for handshake

      What problem are you facing?

      // options: ConnectionOptions
      // The options need to be filtered properly, Connection options differ from Command options
      const handshakeOptions: CommandOptions = { ...options };
      // ^? Type '{ id: number | "<monitor>"; generation: number; hostAddress: HostAddress; autoEncrypter?: AutoEncrypter | undefined; serverApi?: ServerApi | undefined; ... 38 more ...; proxyPassword?: string | undefined; }' is not assignable to type 'CommandOptions'
      

      While cleaning up legacy Object.assign invocations which hide typescript errors, it was identified that the options passed to connection.command for the handshake are all the options that are specified for connecting. There are connect options from Node.js that use the same name as options we would pass to command. Example: "session" which represents a TLS Session but is the same name for a ClientSession option.

            Assignee:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: