Standardized gremlin-js connection options#3472
Open
GumpacG wants to merge 1 commit into
Open
Conversation
Assisted-by: Kiro: Claude Opus 4.8
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3472 +/- ##
============================================
+ Coverage 76.35% 76.43% +0.07%
- Complexity 13424 13666 +242
============================================
Files 1012 1025 +13
Lines 60341 61656 +1315
Branches 7075 7204 +129
============================================
+ Hits 46076 47127 +1051
- Misses 11548 11676 +128
- Partials 2717 2853 +136 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kenhuuu
reviewed
Jun 22, 2026
| "buffer": "^6.0.3", | ||
| "eventemitter3": "^5.0.1" | ||
| "eventemitter3": "^5.0.1", | ||
| "undici": "6.27.0" |
Contributor
There was a problem hiding this comment.
A community member spent quite a bit of effort trying to make the javascript driver work in the browser. Will this dependency make it impossible for it to work in the browser moving forward?
Contributor
There was a problem hiding this comment.
not sure what's possible, but can we produce a smoke test of some sort that would help defend that functionality?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standardize
gremlin-javascriptconnection optionsImplements the JavaScript portion of the TinkerPop 4.x GLV connection-options standardization. Adopts
undicias a pinned dependency and builds an explicit dispatcher so the standardized options take effect, adds a set of new options, removes dead WebSocket-era fields, and deprecatesheaders. JavaScript driver changes only; the other GLVs follow in separate PRs.Proposal: https://lists.apache.org/thread/yqtr2wnb1kq2pqqq4002cz511q5o0bkg
New options
maxConnections(128) - caps concurrent connections per origin on the default dispatcher (previously uncapped). (breaking)readTimeout- per-read idle (body) timeout in ms (undicibodyTimeout); resets per chunk, so it is streaming-safe.maxResponseHeaderBytes- maximum response header size in bytes (undicimaxHeaderSize).keepAliveTime(30000 ms) - idle time before TCP keep-alive probes begin; enablesSO_KEEPALIVEvia a custom undici connector. Set0to disable.proxy- HTTP proxy URI; routes requests through an undiciProxyAgent.compression('none'/'deflate', default'deflate') - the wire compression negotiated with the server. (breaking)defaultBatchSize(64) - connection-level default that fills a request'sbatchSizewhen unset.bulkResults(default false) - connection-level default forbulkResults, applied to every request unless overridden per-request. TheDriverRemoteConnectiontraversal path defaults totrueregardless of this setting.logger- a logger object (withdebug/info/warn/errormethods) or a(level, message, ...args)callback. Disabled when unset.Behavior changes (breaking)
undicias a pinned dependency (6.27.0). The driver now builds and owns an explicit undici dispatcher from the discrete options above; previously the options were declared but not wired to anything.compressiondefaults to'deflate'(on), so the driver sendsAccept-Encoding: deflateby default. Setcompression: 'none'to disable; this also suppresses the auto-injectedAccept-Encodingso compression is not silently negotiated. Defaulting on is a deliberate deviation from the proposal's agreed default-off, applied consistently across the GLVs by later agreement.maxConnectionsnow caps concurrent connections at 128 (was uncapped).Removed (breaking)
agent,ca,cert,pfx, andrejectUnauthorizedTLS fields - they were declared (WebSocket-era leftovers) but never wired to the HTTP transport. TLS is now configured through the Node/undici runtime (NODE_EXTRA_CA_CERTS,NODE_TLS_REJECT_UNAUTHORIZED).Deprecated
headers- retained as a deprecated option (implemented via a synthesized interceptor that emits a one-time warning). Set custom headers via an interceptor instead, e.g.interceptors: (req) => { req.headers['X-Custom'] = 'value'; }.Bug fix
Client.submit()so that an explicitbulkResults: falserequest option is forwarded to the server instead of being silently dropped.Notes
connectTimeout/idleTimeout/writeTimeoutas driver options (the undici runtime defaults are used), and TLS is runtime-delegated rather than a driver option. No publicdispatcheroption is exposed; the dispatcher is built internally from the discrete options.Testing
gremlin-javascriptbuilds (dual CJS/ESM) and all 358 unit tests pass, including newclient,connection,dispatcher, andloggersuites covering the option-to-undici mapping, compression negotiation, keep-alive wiring, andbulkResultsprecedence.Assisted-by: Kiro: Claude Opus 4.8