BUG: version 10.0.0 reintroduces agentOptions, but does not pass it down correctly
In createHost additional agentOptions can be passed to configure undici (https://github.com/arangodb/arangojs/blob/c13259a05ee55554136b905db3375d223cbbd365/src/connection.ts#L62). Unfortunately in all calls, the agentOptions are not passed down to this function, so there is no way to actually configure undici.
References, where createHost is called:
- https://github.com/arangodb/arangojs/blob/c13259a05ee55554136b905db3375d223cbbd365/src/connection.ts#L1019
- https://github.com/arangodb/arangojs/blob/c13259a05ee55554136b905db3375d223cbbd365/src/connection.ts#L996
As you can easily spot in the functions, that call createHost, they already lack the additional parameters. Took some time to get down to this as I want to allow self signed certs and couldn't figure out why it fails, although I passed the params in every possible way and combination.
Oops! Quite the oversight, sorry about that. I guess I accidentally dropped that during refactoring.
The Connection class should store the config.agentOptions in a protected property _agentOptions and use that when calling createHost: https://github.com/arangodb/arangojs/blob/c13259a05ee55554136b905db3375d223cbbd365/src/connection.ts#L702
Seems significant enough that we'd want to ship a bugfix for this.
I'm no longer going to be with ArangoDB next month so @cmyk47 or @shd8 might want to take a look at this.
Since connection is also constructed in Database constructor, this means you cannot set agentOptions anywhere..?
https://github.com/arangodb/arangojs/blob/c13259a05ee55554136b905db3375d223cbbd365/src/databases.ts#L207
Is there any plan to fix this any time soon? It is a rather glaring bug which prevents us from adopting 10.0 at all.