arangojs icon indicating copy to clipboard operation
arangojs copied to clipboard

BUG: version 10.0.0 reintroduces agentOptions, but does not pass it down correctly

Open phal0r opened this issue 9 months ago • 4 comments

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.

phal0r avatar Mar 10 '25 19:03 phal0r

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.

pluma avatar Mar 25 '25 09:03 pluma

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

robross0606 avatar Jun 04 '25 15:06 robross0606

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.

robross0606 avatar Jul 14 '25 23:07 robross0606