Skip to content

Conversation

@mrorigo
Copy link
Contributor

@mrorigo mrorigo commented Dec 2, 2025

closes #1179

Fixes invalid conditional check by removing maxRetries > 0

Motivation and Context

Incorrect logic

How Has This Been Tested?

test suite passes, 1 test added to verify change

Breaking Changes

No breaking changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@mrorigo mrorigo requested a review from a team as a code owner December 2, 2025 14:10
Copy link
Contributor

@felixweinberger felixweinberger left a comment

Choose a reason for hiding this comment

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

Good find thanks

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 2, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/sdk@1216

commit: 06e0b59

Fix formatting issues that were causing CI to fail:
- Correct indentation on `let transport` declaration
- Remove trailing whitespace
- Remove extra blank line
The previous test didn't properly exercise _scheduleReconnection.
This improved test:
- Directly tests _scheduleReconnection with maxRetries=0
- Verifies the "Maximum reconnection attempts (0) exceeded" error
- Confirms no setTimeout is scheduled (no retry attempt)
- Adds a companion test for maxRetries>0 to verify normal behavior
@felixweinberger
Copy link
Contributor

Made some changes to the tests + fixed CI.

@felixweinberger felixweinberger merged commit bfad917 into modelcontextprotocol:main Dec 2, 2025
6 checks passed
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.

StreamableHttpClientTransport: maxRetries=0 leads to infinite retry

2 participants