Skip to content
Commit Detail

Commit badbc7c

Author
Kenton Varda <kenton@cloudflare.com> 2025-05-16 21:52:58 -0500
Parents
6b17864
Tree
e605204
Refactor: Don't use makeReentryCallback() at top level.

`makeReentryCallback()`, as its name implies, is for *re-*entry, not original entry.

In particular, the callback itself holds a PendingEvent. This does not make sense at the top level, as it would mean there is always a PendingEvent, breaking the whole mechanism for RPC events. (I've added a test which was broken by this.)

It turns out, for the top-level call, we don't really need the complexity of `makeReentryCallback()` anyway. We can arrange to ensure that EntrypointJsRpcTarget cannot outlive the IoContext / IncomingRequest, then just use ctx.run() like normal.

Files changed

3 files changed~3 modified