Skip to content

Fix handle sse disconnect event to free read_stream_writers[session_id] #582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: v1.3.x
Choose a base branch
from

Conversation

lcamhoa
Copy link

@lcamhoa lcamhoa commented Apr 24, 2025

Motivation and Context

When SSE Connection disconnect , we should free the _read_stream_writers

How Has This Been Tested?

  • Test with inspector -> connect -> disconnect

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

@Kludex
Copy link
Member

Kludex commented Apr 25, 2025

This looks better. Can you add a test case, please?

@lcamhoa
Copy link
Author

lcamhoa commented Apr 26, 2025

This looks better. Can you add a test case, please?

I added . Please check

@@ -120,9 +120,19 @@ async def sse_writer():
}
)

async def handle_see_disconnect(message: Message) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

this is also handled in #586. let's review that one first and then we can review this one as we have a test here -- thank you for adding it

@ihrpr ihrpr added this to the 2025-03-26 spec release milestone Apr 29, 2025
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.

3 participants