Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4846 +/- ##
=========================================
Coverage 91.34% 91.34%
Complexity 3875 3875
=========================================
Files 1451 1451
Lines 334425 334425
Branches 268282 268282
=========================================
+ Hits 305495 305496 +1
+ Misses 22716 22715 -1
Partials 6214 6214
🚀 New features to boost your workflow:
|
|
Thanks for the PR. It is labeled If AI assistance was used to create this PR, you are required to run the Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Member
|
Thanks @Dageus, and welcome. Matching the Rust SDK, which already rejects port 0, is a good fix, and testing 65536 instead of 70000 pins the upper bound exactly. The happy path test for 1 and 65535 is worth keeping. |
This branch has not been deployed
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.
Which issue does this PR address?
Closes #4845
Rationale
The Rust SDK rejects port 0 when parsing a connection string, but the Node SDK accepted it and only failed later on connect. Both SDKs should reject the same inputs at parse time.
What changed?
Previously, the Node SDK's
parseConnectionStringaccepted port 0 , which is a reserved port. This PR adds a small check forport == 0, blocking that path.The malformed-input test now covers
:0and:65536(replacing:70000, so the upper bound is tested exactly), and a new test checks that:1and:65535still parse, although the happy path test may be unnecessary and am happy to remove it if it's overkill.Local Execution
npm run test:unitandnpm run lintinforeign/node(Node 24)prek runpassed (license headers, typos, node eslint, whitespace/newline, binary artifacts, skills)AI Usage
Claude was used to make my PR message clearer.