-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add conformance tests for SEP-1699 SSE polling #35
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
Closed
+935
−1
Conversation
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
Adds conformance tests for SEP-1699 (SSE Polling via Server-Side Disconnect) which allows servers to close connections while maintaining SSE streams for long-polling behavior. New scenarios: - server-sse-polling: Tests server sends priming event (id + empty data) and retry field before closing connection (SHOULD requirements) - sse-retry: Tests client respects SSE retry field timing when reconnecting (MUST requirement) These tests will initially fail for TypeScript SDK as it doesn't currently respect the retry field from SSE events.
The test was incorrectly measuring timing between all requests (POST and GET), but the retry field only applies to GET SSE stream reconnections. Changes: - Only track timestamps and Last-Event-ID for GET requests - Return 202 Accepted for notifications to trigger client GET stream - Add eventsource-parser dependency
Enhance timing validation and event ordering checks: Client test (sse-retry): - Add "very late" threshold (>2x retry value) as FAILURE - Distinguish between slightly late (WARNING) and very late (FAILURE) Server test (sse-polling): - Check that priming event is sent immediately (first event) - Warn if server disconnects without sending event ID first
commit: |
The eventsource-parser library delivers retry through onRetry callback, not as a property on EventSourceMessage objects.
Contributor
paoloricciuti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a draft but I tested it locally and I had some comments
95c658f to
25ddecf
Compare
9 tasks
Server may return 400 when GET request is missing session context (mcp-session-id header). Treat as INFO similar to 405.
- Rewrite server tests to validate priming events on POST SSE streams - Update client tests for POST→GET reconnection flow with retry timing - Add eventStore and retryInterval to example server - All 3 server conformance checks now pass
25ddecf to
bc7c649
Compare
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.
Adds conformance tests for SEP-1699 which introduces SSE polling via server-side disconnect.
Summary
Motivation and Context
SEP-1699 introduces SSE polling behavior. These conformance tests ensure SDK implementations correctly handle retry field timing, priming events, and graceful disconnection.
How Has This Been Tested?
Breaking Changes
None.
Types of changes
Checklist