Skip to content

Commit

Permalink
WIP: No more empty outputs from modeling API
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchalmers committed Sep 19, 2024
1 parent d8236dd commit 7c22890
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/wasm-lib/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/wasm-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ members = [
http = "0.2.12"
kittycad = { version = "0.3.20", default-features = false, features = ["js", "requests"] }
kittycad-modeling-session = "0.1.4"
kittycad-modeling-cmds = { version = "0.2.59", features = ["websocket"] }
kittycad-modeling-cmds = { git = "https://github.com/KittyCAD/modeling-api", branch="achalmers/no-more-empty", features = ["websocket"] }

[[test]]
name = "executor"
Expand Down
5 changes: 3 additions & 2 deletions src/wasm-lib/kcl/src/engine/conn_mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use anyhow::Result;
use indexmap::IndexMap;
use kcmc::{
ok_response::OkModelingCmdResponse,
output as mout,
websocket::{
BatchResponse, ModelingBatch, OkWebSocketResponseData, SuccessWebSocketResponse, WebSocketRequest,
WebSocketResponse,
Expand Down Expand Up @@ -71,7 +72,7 @@ impl crate::engine::EngineManager for EngineConnection {
responses.insert(
request.cmd_id,
BatchResponse::Success {
response: OkModelingCmdResponse::Empty {},
response: OkModelingCmdResponse::StartPath(mout::StartPath {}),
},
);
}
Expand All @@ -84,7 +85,7 @@ impl crate::engine::EngineManager for EngineConnection {
_ => Ok(WebSocketResponse::Success(SuccessWebSocketResponse {
request_id: Some(id),
resp: OkWebSocketResponseData::Modeling {
modeling_response: OkModelingCmdResponse::Empty {},
modeling_response: OkModelingCmdResponse::StartPath(mout::StartPath {}),
},
success: true,
})),
Expand Down
2 changes: 1 addition & 1 deletion src/wasm-lib/kcl/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
// Return early if we have no commands to send.
if all_requests.is_empty() {
return Ok(OkWebSocketResponseData::Modeling {
modeling_response: OkModelingCmdResponse::Empty {},
modeling_response: OkModelingCmdResponse::StartPath(kcmc::output::StartPath {}),
});
}

Expand Down

0 comments on commit 7c22890

Please sign in to comment.