Skip to content
Commit Detail

Commit f840511

Author
Dan Lapid <dan.lapid@gmail.com> 2025-12-17 23:02:07 +0000
Parents
693b5e7
Tree
384d918
Fix JSRPC Return event timing to fire when handler returns

Previously, the Return tracing event for JSRPC calls was emitted when
the entire session completed (after all streams were consumed and
capabilities released). This was incorrect - the Return event should
mark when the handler returned a value, not when all data transfer
finished.

Move setReturn() from JsRpcSessionCustomEvent::run() completion to
EntrypointJsRpcTarget::call() completion. This ensures the Return
event fires at the correct time in the request lifecycle.

Add tests that validate:
- Return event occurs before Outcome event
- Return event occurs at least 200ms after onset (handler work time)
- Gap between Return and Outcome is at least 200ms (stream drain time)

Files changed