Skip to content

feat(node): support connection string syntax for nodejs client creation - #3917

Merged
hubcio merged 2 commits into
apache:masterfrom
T1B0:add-connection-string-support-node-sdk
Aug 28, 2026
Merged

feat(node): support connection string syntax for nodejs client creation#3917
hubcio merged 2 commits into
apache:masterfrom
T1B0:add-connection-string-support-node-sdk

Conversation

@T1B0

@T1B0 T1B0 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

this PR add node sdk support for connection string syntax on client creation
accept common url like syntax new Client("iggy://iggy:iggy@127.0.0.1:8090");

note node:url module was not used since it would have introduced small differencez with rust and other sdk parsing, so connection string is manually parsed to match others sdk behaviors.

@T1B0
T1B0 requested review from hubcio and spetz August 18, 2026 16:15
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Aug 18, 2026
@T1B0
T1B0 force-pushed the add-connection-string-support-node-sdk branch from 2afce42 to e9ffac3 Compare August 18, 2026 16:16
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.77217% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.31%. Comparing base (db14a4b) to head (ca3fc22).

Files with missing lines Patch % Lines
foreign/node/src/duration.utils.ts 98.21% 7 Missing ⚠️
...oreign/node/src/client/client.connection-string.ts 99.11% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3917      +/-   ##
============================================
- Coverage     84.70%   84.31%   -0.39%     
  Complexity     1398     1398              
============================================
  Files          1221     1222       +1     
  Lines        175949   174317    -1632     
  Branches     143047   140840    -2207     
============================================
- Hits         149037   146978    -2059     
- Misses        22941    23382     +441     
+ Partials       3971     3957      -14     
Components Coverage Δ
Rust Core 85.09% <ø> (-0.54%) ⬇️
Java SDK 67.23% <ø> (ø)
C# SDK 75.39% <ø> (ø)
Python SDK 90.06% <ø> (ø)
PHP SDK 85.65% <ø> (ø)
Node SDK 96.14% <98.77%> (+0.07%) ⬆️
Go SDK 69.09% <ø> (ø)
Files with missing lines Coverage Δ
foreign/node/src/client/client.config.ts 100.00% <100.00%> (ø)
foreign/node/src/client/client.connection.ts 97.49% <100.00%> (+0.08%) ⬆️
foreign/node/src/client/client.socket.ts 97.00% <100.00%> (+<0.01%) ⬆️
foreign/node/src/client/client.ts 97.17% <100.00%> (-0.02%) ⬇️
foreign/node/src/constant.ts 100.00% <100.00%> (ø)
foreign/node/src/stream/consumer-stream.ts 70.42% <100.00%> (-5.64%) ⬇️
...oreign/node/src/client/client.connection-string.ts 99.11% <99.11%> (ø)
foreign/node/src/duration.utils.ts 98.21% <98.21%> (ø)

... and 74 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@T1B0
T1B0 force-pushed the add-connection-string-support-node-sdk branch 5 times, most recently from 6a3b7a1 to 44edc7c Compare August 22, 2026 17:58
Comment thread foreign/node/src/client/client.connection-string.ts Outdated
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Aug 23, 2026
@T1B0
T1B0 force-pushed the add-connection-string-support-node-sdk branch from 44edc7c to be0d997 Compare August 24, 2026 10:36
slbotbm
slbotbm previously approved these changes Aug 24, 2026
@T1B0
T1B0 force-pushed the add-connection-string-support-node-sdk branch 4 times, most recently from 3745728 to 3de15b0 Compare August 25, 2026 07:30

@hubcio hubcio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few notes from comparing against the rust parser. one i'd want fixed before merge - the credential echo in errors.

these landed outside the diff:

foreign/node/src/stream/consumer-stream.ts:81 and :113 - singleConsumerStream and groupConsumerStream still take ClientConfig, so passing a connection string fails to compile (TS2345). they call the widened getClient, and since getClient isn't exported they're the only place users can reach the widening.

foreign/node/src/client/client.connection.ts:86-90 - reconnect timer is never unref'd and the handle isn't kept, so unlimited means the process can't exit and destroy() can't cancel a wait already in flight. the heartbeat timer next door unrefs itself with a comment saying why. pre-existing, but this PR makes unlimited a one-word option and ships it in the new e2e.

foreign/node/src/client/client.config.ts:61 - error says heartbeatInterval in raw ms at someone who typed heartbeat_interval=1000h.

nothing tests the tls branch - the pre-merge action runs tls.system.e2e.ts, which builds from an object config, so the parser never gets hit.

Comment thread foreign/node/src/client/client.connection-string.ts Outdated
Comment thread foreign/node/src/client/client.connection-string.ts Outdated
Comment thread foreign/node/src/client/client.connection-string.ts Outdated
Comment thread foreign/node/src/client/client.connection-string.ts
Comment thread foreign/node/src/client/client.connection-string.ts Outdated
Comment thread foreign/node/src/client/client.connection-string.ts Outdated
Comment thread foreign/node/src/client/client.connection-string.ts Outdated
Comment thread foreign/node/src/client/index.ts Outdated
Comment thread foreign/node/README.md Outdated
Comment thread foreign/node/src/e2e/tcp.connection-string.e2e.ts
@T1B0
T1B0 force-pushed the add-connection-string-support-node-sdk branch 6 times, most recently from 83122df to 8c10423 Compare August 25, 2026 17:10
@T1B0
T1B0 requested a review from hubcio August 25, 2026 17:10

@hubcio hubcio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

round 2 - everything from the first pass landed, thanks. one new blocker though: the timer change in waitForReconnect settles the promise right away, so the reconnect loop no longer waits at all (numbers inline). two smaller things worth landing with it: the parse-duration grammar is looser than the rust one the README promises, and the new reconnect.interval check rejects configs that disable reconnect. the rest is nits.

Comment thread foreign/node/src/client/client.connection.ts Outdated
Comment thread foreign/node/src/client/client.connection-string.ts Outdated
Comment thread foreign/node/src/client/client.config.ts
Comment thread foreign/node/src/client/client.type.ts
Comment thread foreign/node/README.md Outdated
Comment thread foreign/node/src/stream/consumer-stream.ts Outdated
@T1B0
T1B0 force-pushed the add-connection-string-support-node-sdk branch from a09ab2e to 249f21e Compare August 26, 2026 15:41
@T1B0
T1B0 force-pushed the add-connection-string-support-node-sdk branch 9 times, most recently from 979889c to e7e5d2d Compare August 28, 2026 11:18
@T1B0
T1B0 force-pushed the add-connection-string-support-node-sdk branch from e7e5d2d to fe24bbc Compare August 28, 2026 12:22
@hubcio
hubcio merged commit 90e38b1 into apache:master Aug 28, 2026
55 checks passed
@github-actions github-actions Bot removed the S-waiting-on-author PR is waiting on author response label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants