rust-sdk/crates/rmcp/tests
Anar Azadaliyev 65d2b29da5
fix(server): remove initialized notification gate to support Streamable HTTP (#788)
* fix(server): remove initialized notification gate to support Streamable HTTP

The server's init handshake loop fatally rejected any request arriving
before the `notifications/initialized` message. This breaks Streamable
HTTP clients where each JSON-RPC message is a separate POST with no
ordering guarantee — `tools/list` can easily arrive before `initialized`.

Remove the ~40-line wait loop and enter `serve_inner` immediately after
sending `InitializeResult`. The `initialized` notification is now
handled as a regular notification by the main service loop, matching the
TypeScript SDK behavior (validated in typescript-sdk#578).

Also remove the now-unreachable `ExpectedInitializedNotification` error
variant from `ServerInitializeError`.

Closes #783

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(server): keep ExpectedInitializedNotification as deprecated

Retain the variant for semver compatibility — removing it would be a
breaking change caught by cargo-semver-checks. Mark it deprecated with
a note that it is never constructed and will be removed in a future
major release.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Anar Azadaliyev <anar.azadaliye@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 19:23:59 -04:00
..
common feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_deserialization fix(tasks): expose execution.taskSupport on tools (#635) 2026-02-03 19:17:36 -05:00
test_message_schema feat: add meta to elicitation results (#792) 2026-04-08 15:07:04 -04:00
test_with_js refactor: provide http server as tower service (#228) 2025-05-28 19:21:40 +08:00
test_with_python feat: Add prompt support (#351) 2025-08-21 11:22:19 +08:00
test_client_credentials.rs feat: implement OAuth 2.0 Client Credentials flow (#707) 2026-03-03 20:53:51 -05:00
test_client_initialization.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_close_connection.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_completion.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_complex_schema.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_custom_headers.rs fix(http): add host check (#764) 2026-04-01 19:28:56 -04:00
test_custom_request.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_deserialization.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_elicitation.rs feat: add meta to elicitation results (#792) 2026-04-08 15:07:04 -04:00
test_embedded_resource_meta.rs Spec conformance: meta support and spec updates (#415) 2025-09-04 14:23:36 -04:00
test_handler_wrappers.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_inflight_response_drain.rs feat: add Default and constructors to ServerSseMessage (#794) 2026-04-08 16:39:16 -04:00
test_json_schema_detection.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_logging.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_message_protocol.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_message_schema.rs chore(deps): update schemars requirement from 0.8 to 1.0 (#258) 2025-07-11 11:15:45 +08:00
test_notification.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_progress_subscriber.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_prompt_handler.rs feat(macros): auto-generate get_info and default router (#785) 2026-04-08 15:06:26 -04:00
test_prompt_macro_annotations.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_prompt_macros.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_prompt_routers.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_resource_link.rs feat: add resource_link support to tools and prompts (#381) 2025-08-29 18:13:38 +08:00
test_resource_link_integration.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_sampling.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_server_initialization.rs fix(server): remove initialized notification gate to support Streamable HTTP (#788) 2026-04-09 19:23:59 -04:00
test_sse_concurrent_streams.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_streamable_http_4xx_error_body.rs fix(rmcp): surface JSON-RPC error bodies on HTTP 4xx responses (#748) 2026-03-17 09:27:45 -04:00
test_streamable_http_json_response.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_streamable_http_priming.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_streamable_http_stale_session.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_structured_output.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_task.rs fix(tasks): avoid dropping completed task results during collection (#639) 2026-02-05 09:00:09 +01:00
test_task_support_validation.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_tool_builder_methods.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_tool_handler.rs Move whole rmcp crate to offcial rust sdk (#44) 2025-03-27 17:33:41 -04:00
test_tool_macro_annotations.rs feat(macros): auto-generate get_info and default router (#785) 2026-04-08 15:06:26 -04:00
test_tool_macros.rs feat(macros): auto-generate get_info and default router (#785) 2026-04-08 15:06:26 -04:00
test_tool_result_meta.rs chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715) 2026-03-03 10:38:01 -05:00
test_tool_routers.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00
test_unix_socket_transport.rs feat(transport): add Unix domain socket client for streamable HTTP (#749) 2026-03-24 09:50:32 -04:00
test_with_js.rs chore: add #[non_exhaustive] to remaining public structs (#768) 2026-03-26 10:23:58 -04:00
test_with_python.rs feat: add local feature for !Send tool handler support (#740) 2026-03-11 17:22:56 -04:00