Skip to content
Commit Detail

Commit 4c64813

Author
Felix Hanau <felix@cloudflare.com> 2025-08-23 12:32:02 -0400
Parents
8bc9530
Tree
cc16408
EW-9282	EW-9451 Fix missing onset event for JSRpc edge cases

If we invoke a customEvent, we should generally report an onset event to the
tracer right away. Under the STW model, we must do so if there's any chance for
events like spans/logs being generated from JS (this wasn't the case with LTW so
far).
For JSRPC, we would only create an onset event after we were able to
successfully get a function or property to call, but we may invoke JS code
before that (e.g. if a JS getter method produced a log). Accordingly, set the
onset as soon as we know the function name to report with it to avoid getting
errors based on other events being sent before the onset.
Note that this does result in traces being generated in some error cases (e.g.
when a function lookup fails), but this is arguably the right approach, those
JsRpcSessionCustomEventImpl invocations shouldn't just disappear.

Files changed

1 file changed~1 modified