Files
pubsub/tasks/018-integration-test-ws-client-server.md

1.8 KiB

id, name, status, depends_on, scope, risk, impact, level
id name status depends_on scope risk impact level
integration-test-ws-client-server Integration test: WebSocket client and server event targets together pending
websocket-client-tests
websocket-server-tests
moderate medium component implementation

Description

Test the WebSocket client and server adapters working together — a spoke subscribes via the client adapter, the hub fans out via the server adapter. This validates the full subscription control protocol end-to-end:

  1. Client connects to server
  2. Client calls addEventListener → sends __subscribe to server
  3. Server receives __subscribe → adds client to subscription map
  4. Server dispatchEvent on that topic → message sent only to subscribed client
  5. Client receives message → dispatches to local listeners
  6. Client calls removeEventListener → sends __unsubscribe to server
  7. Server removes client from subscription map

This is also where we validate that createPubSub works with the WebSocket adapters.

Acceptance Criteria

  • Integration test: bidirectional communication between WS client and server
  • Integration test: subscription control protocol end-to-end
  • Integration test: topic-based fan-out — subscribed clients receive events, unsubscribed don't
  • Integration test: direct messaging via topic scoping "direct:${spokeId}"
  • Integration test: createPubSub works with WS client event target
  • Integration test: createPubSub works with WS server event target

References

  • docs/architecture/event-targets/websocket-client.md
  • docs/architecture/event-targets/websocket-server.md
  • docs/architecture/decisions/003-subscription-control-protocol.md

Notes

To be filled by implementation agent

Summary

To be filled on completion