- Issues
- #155
response.webSocket from a DO subrequest never delivers message events
steventsao opened ·
celld 0.2.1, macOS arm64, single node, MinIO bucket backend.
**What we did:** a fetch handler in the same deployment upgrades to a Durable Object via `stub.fetch(new Request(url, { headers: { Upgrade: 'websocket', ... } }))`, takes `response.webSocket`, calls `.accept()`, and listens for `message`. The DO side is a partyserver/agents-sdk `Agent` — its `onConnect` fires and it `connection.send()`s / broadcasts to the connection.
**What happens:** the DO sees the connection (it appears in `getConnections()` with state, and broadcasts target it), but the client-side socket never fires a single `message` event. No error on either side; the stream just stays silent. External client WebSockets to the same DO path close abnormally (1006) as well.
**What works:** DO fetch subrequests with streaming `ReadableStream` response bodies deliver chunks live (`CelldHttpBodyStream`) and keep the DO isolate alive while open — we moved our event channel onto that and it is fully functional.
**Expected:** `response.webSocket` delivers DO-sent messages, per the Workers API.
Happy to reduce to a minimal repro if useful — the current repro is the okra engine (`steventsao/okra`, `apps/api/packages/server` engine build) whose `GET /v1/documents/:id/events` route did exactly this upgrade and saw zero frames across dozens of broadcast events.
bartlomiejureferenced 9c0ca09ef5d53 months ago on GitHub
bartlomiejureferenced bc0e29cddf303 months ago on GitHub
bartlomiejureferenced 89e4ffc53a143 months ago on GitHub
tboserreferenced this in WebSocket upgrade returned by the stateless Worker gets no handshake headers #1673 months ago on GitHub