Skip to content
Commit Detail

Commit d05081b

Author
Kenton Varda <kenton@cloudflare.com> 2025-12-19 22:15:24 -0600
Parents
d8f9149
Tree
4e94ebc
Add rpc_params_dup_stubs compat flag.

This flag changes the Worker RPC behavior to match Cap'n Web: When a stub is passed in the params of an RPC method, we should NOT transfer ownership of the stub. Instead, the stub is dup()ed.

The comments explain in more detail why these semantics are superior (and thus why Cap'n Web took them).

Additionally, in the case that the params contain an `RpcTarget`, if that target has a `dup()` method, we call it. This specifically fixes an interoperability bug with Cap'n Web: https://github.com/cloudflare/capnweb/issues/110

Files changed