feat(transport): CEP-41 open-ended streams#71
Conversation
- add CEP-41 end-to-end and unit coverage for stream lifecycle, accept-gated bootstrap, malformed progress payloads, and keepalive behavior - add writer tests for ping/pong nonce handling and optional close.lastChunkIndex - update open-stream frame types/builders and writer behavior for nonce support and relaxed close metadata - harden open-stream registry/session handling and apply the lint-safe deferred typing fix
…dOpenStreamSession in test
|
Hey! Awesome work on this draft PR. The architecture looks really solid. (The I did a deep dive into the code and found a couple of bugs and edge cases to look at before we finalize: 1.
|
|
Btw I’d keep 'Monkey-patching writer methods' only as a non-blocking design comment (The |
…for open streams Add idle timeout, probe timeout, and close grace period support to the CEP-41 open stream implementation. Sessions now send periodic ping frames when idle and abort if no matching pong is received within the probe timeout. Also add lifecycle hooks (onClose, onAbort) to OpenStreamWriter for proper cleanup after terminal frames are published. The registry now supports a getSessionOptions callback for deriving session configuration at creation time.
|
Please review again @1amKhush . Your comments were attached in the last commit |
|
Looking great @ContextVM-org ! Looks great, all the issues I flagged are addressed 👍 Just had 2 minor/ 'good to have' things (the current implementation is great as is, so i think these can be ignored)
Rest the implementation is really solid at this point! All 6 original issues were fixed properly, the keepalive timers are fully wired, and the buffer limits use real policy values. |
Add ping frame handling to NostrServerTransport that responds with pong, enabling client-side keepalive probes to be acknowledged. Also add comprehensive e2e tests verifying stream keepalive across idle timeouts, probe timeout abort behavior, and interleaved control frame handling.
|
Added these test and some more. Let me know your thoughts |
Looking great! |
Add assertions to verify that the dispose method properly closes sessions after tests complete, ensuring proper cleanup of resources in both e2e and unit tests for the CEP-41 stream implementation.
…on tests This change makes the optional advisory fields in CEP-41 open-stream frames (contentType, lastChunkIndex, reason) truly optional by only including them when defined, rather than always sending undefined values. It also adds comprehensive unit tests for: - Start frames with advisory metadata omitted - Malformed progress payload rejection - Accept frame sequence validation - Unexpected pong frame handling Additionally improves ping nonce generation to use a unique token-based format for better debugging.
Implementing ContextVM/contextvm-docs#40