denoland/celldPublic

self-hosted, distributed Durable Objects

WebSocket RPC calls never resolve under celld dev (Cap'n Web served over Workers WebSocketPair)

DI

I have a Worker running under `celld dev` that serves Cap'n Web RPC using capnweb's own `newWorkersRpcResponse` helper, no framework involved. Every RPC call made over the WebSocket transport hangs forever, it never resolves and never rejects. This is 100% reproducible, not intermittent. I tested five fresh connections in a row and all five hung on the very first call.

Plain HTTP batch RPC (`newHttpBatchRpcSession`) against the same worker works every time, so this is isolated to the WebSocket transport.

**Environment**

- celld 0.4.0, run via `celld dev` - capnweb ^0.12.0

**Repro**

```ts // worker.ts — run with `celld dev` import { RpcTarget, newWorkersRpcResponse } from 'capnweb';

interface PublicApi { hello(name: string): string; }

class Api extends RpcTarget implements PublicApi { hello(name: string) { return `Hello, ${name}!`; } }

export default { fetch(request: Request) { return newWorkersRpcResponse(request, new Api()); }, };

// client.ts — run against the worker above once `celld dev` is up import { newWebSocketRpcSession } from 'capnweb';

const stub = newWebSocketRpcSession('ws://127.0.0.1:9876/api'); console.log(await stub.hello('first call')); // never resolves ```

**Steps**

1. Start the worker above with `celld dev`. 2. Run the client against it. 3. `hello()` never resolves, no error, no rejection, on every attempt.

**Expected:** the call resolves, same as it does over HTTP batch RPC.

**Actual:** the WebSocket upgrade completes (101 response), but no RPC response ever comes back over it.

Also note: This is proven on the celld side, the same runs properly on `wrangler dev`. I also have a patch locally that works for `celld`, but PRs are disabled :(

  1. dacuna-icrenamed WebSocket RPC calls hang after the first message when serving Cap'n Web over a Worker socket to WebSocket RPC calls never resolve under celld dev (Cap'n Web served over Workers WebSocketPair)2 months ago on GitHub

  2. BA

    Feel free to send patch to bartek[at]Deno.com

  3. bartlomiejuclosed2 months ago on GitHub

  4. BA

    Thanks, I did use parts of your patch. This will be released later this week.

  5. bartlomiejureferenced fd7b96b993f52 months ago on GitHub

  6. bartlomiejureferenced b61356b29deb2 months ago on GitHub

  7. bartlomiejureferenced 7ac68e0bd2a72 months ago on GitHub

  8. bartlomiejureferenced 10cb1303dac72 months ago on GitHub