3 Commits

3 changed files with 11 additions and 10 deletions

View File

@@ -779,10 +779,11 @@ mod tests {
let out = handle_inbound_envelope(&dp, &conn, request)
.await
.expect("response");
assert_eq!(out.r#type, EVENT_ERROR);
assert_eq!(out.r#type, EVENT_RESPONDED);
assert_eq!(out.id, "sub-0");
assert_eq!(
out.payload.get("code"),
Some(&serde_json::json!("INVALID_OPERATION_TYPE"))
out.payload.get("output"),
Some(&serde_json::json!({ "n": 1 }))
);
}
@@ -1077,10 +1078,10 @@ mod tests {
MockMsg::Binary(bytes) => {
let env: EventEnvelope = serde_json::from_slice(&bytes).unwrap();
assert_eq!(env.id, "sub-ws-0");
assert_eq!(env.r#type, EVENT_ERROR);
assert_eq!(env.r#type, EVENT_RESPONDED);
assert_eq!(
env.payload.get("code"),
Some(&serde_json::json!("INVALID_OPERATION_TYPE"))
env.payload.get("output"),
Some(&serde_json::json!({ "n": 1 }))
);
}
other => panic!("expected binary, got {other:?}"),

View File

@@ -1,7 +1,7 @@
---
id: http/server/subscribe-sse-streaming
name: Wire /subscribe handler to GatewayDispatch::invoke_streaming() and pipe BoxStream to SSE
status: pending
status: completed
depends_on: [http/gateway/invoke-streaming]
scope: narrow
risk: medium
@@ -153,4 +153,4 @@ stream is dropped (not leaked) on disconnect.
## Summary
> To be filled on completion
> Replaced /subscribe one-event placeholder with real streaming path. subscribe_handler now calls GatewayDispatch::invoke_streaming() and pipes BoxStream to SSE via subscribe_stream_from_envelope_stream (StreamExt::map). Ok → data: frame, Err → event:error (terminal, stream ends after). Removed placeholder helpers (subscribe_stream_from_envelope, envelope_to_sse_stream). Kept subscribe_stream_internal_error for Internal ops (NOT_FOUND). Added 6 unit tests. Also fixed 2 pre-existing websocket subscription tests that expected INVALID_OPERATION_TYPE but now get call.responded (dispatch_requested routes Subscription via invoke_streaming). 247 tests pass.

View File

@@ -1,7 +1,7 @@
---
id: review-streaming-impl
name: Review ADR-049 streaming handler implementation for spec conformance and end-to-end correctness
status: pending
status: completed
depends_on: [call/protocol/dispatch-streaming-branch, call/client/from-call-streaming-forwarding, http/gateway/invoke-streaming, http/server/subscribe-sse-streaming, http/adapters/from-openapi-sse-streaming]
scope: broad
risk: low
@@ -207,4 +207,4 @@ review.
## Summary
> To be filled on completion
> Reviewed ADR-049 streaming handler implementation across all 12 checklist points. All type surface, registry, builder, dispatch, from_call, gateway, /subscribe SSE, from_openapi SSE, ADR conformance, end-to-end correctness, pattern consistency, and test coverage items verified. 555 tests pass (306 call + 2 integration + 247 http), clippy clean, fmt clean. Fixed 2 pre-existing websocket subscription tests that expected INVALID_OPERATION_TYPE but now get call.responded (dispatch_requested routes Subscription via invoke_streaming). All 9 ADR-049 decisions implemented. Placeholders removed (subscribe_stream_from_envelope, envelope_to_sse_stream, stream_subscription). from_mcp unchanged (always HandlerKind::Once).