swift-sdk/Tests/MCPTests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mattt bdaa2585c5
Delay SSE GET connection until after session ID is established (#97)
* Delay SSE GET connection until after session ID is established

- Add a signaling mechanism to ensure the SSE streaming task waits for the initial session ID to be set before attempting the GET connection.
- Use a TaskGroup to race between session ID signal and a 10-second timeout, logging the outcome.
- Trigger the signal when a session ID is received for the first time from any response.
- Add detailed logging for all code paths to aid debugging and clarify connection timing.
- Clean up signal resources on disconnect to prevent leaks.

This addresses the initialization timing issue where the SSE GET could be attempted before the session was established, as discussed in MCP PR #91.

* Update tests for SSE timing

* Use configurable timeout for acquiring session ID

* Remove Actor protocol conformance for HTTPClientTransport

* Configure shorter session ID timeout for tests

* Add documentation comments to HTTPClientTransport

* Rename sessionIDWaitTimeout to sseInitializationTimeout
2025-05-06 06:49:48 -07:00
..
Helpers Add support for JSON-RPC batching (#67) 2025-04-10 12:13:41 -07:00
ClientTests.swift Send initialized notification from client instead of server (#85) 2025-04-21 14:43:33 -07:00
HTTPClientTransportTests.swift Delay SSE GET connection until after session ID is established (#97) 2025-05-06 06:49:48 -07:00
IDTests.swift Initial implementation 2025-02-11 15:22:35 -08:00
NotificationTests.swift Update AnyNotification to include notification params (#86) 2025-04-27 06:47:38 -07:00
PromptTests.swift Add support for audio content in prompts and tool results (#73) 2025-04-15 05:41:28 -07:00
RequestTests.swift Add unit test to check that AnyRequest handles missing parameters (#24) 2025-03-19 05:41:50 -07:00
ResourceTests.swift Allow params field to be omitted in requests for methods that don't require them (#17) 2025-03-17 05:26:47 -07:00
ResponseTests.swift Add support for JSON-RPC batching (#67) 2025-04-10 12:13:41 -07:00
RoundtripTests.swift Add support for Linux with glibc (#61) 2025-04-10 05:22:56 -07:00
ServerTests.swift Send initialized notification from client instead of server (#85) 2025-04-21 14:43:33 -07:00
StdioTransportTests.swift Add streamable HTTP transport for clients (#70) 2025-04-15 09:06:29 -07:00
ToolTests.swift Implement Tool.Annotations (#47) 2025-04-15 05:42:44 -07:00