fix: remove batched json rpc support (#408)

* fix: remove batched json rpc  support

* fix(test): fix schema
This commit is contained in:
4t145 2025-09-03 14:13:55 +08:00 • committed by GitHub
commit f381c2b899
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3497 deletions

View file

@ -468,10 +468,6 @@ impl LocalSessionWorker {
OutboundChannel::Common
}
}
ServerJsonRpcMessage::BatchRequest(_) | ServerJsonRpcMessage::BatchResponse(_) => {
// the server side should never yield a batch request or response now
unreachable!("server side won't yield batch request or response")
}
}
}
async fn handle_server_message(
@ -824,20 +820,6 @@ impl Worker for LocalSessionWorker {
crate::model::JsonRpcMessage::Notification(notification) => {
self.catch_cancellation_notification(notification)
}
crate::model::JsonRpcMessage::BatchRequest(items) => {
for r in items {
match r {
crate::model::JsonRpcBatchRequestItem::Request(request) => {
if let Some(http_request_id) = http_request_id {
self.register_request(request, http_request_id)
}
}
crate::model::JsonRpcBatchRequestItem::Notification(
notification,
) => self.catch_cancellation_notification(notification),
}
}
}
_ => {}
}
context.send_to_handler(json_rpc_message).await?;

View file

@ -319,12 +319,6 @@ where
.map_err(internal_error_response("accept message"))?;
Ok(accepted_response())
}
_ => Ok(Response::builder()
.status(http::StatusCode::NOT_IMPLEMENTED)
.body(
Full::new(Bytes::from("Batch requests are not supported yet")).boxed(),
)
.expect("valid response")),
}
} else {
let (session_id, transport) = self
@ -427,10 +421,6 @@ where
}
ClientJsonRpcMessage::Response(_json_rpc_response) => Ok(accepted_response()),
ClientJsonRpcMessage::Error(_json_rpc_error) => Ok(accepted_response()),
_ => Ok(Response::builder()
.status(http::StatusCode::NOT_IMPLEMENTED)
.body(Full::new(Bytes::from("Batch requests are not supported yet")).boxed())
.expect("valid response")),
}
}
}