Ivan FB 851409aca4
test(e2e): event handler can re-enter the library with a new request
Adds a C++ e2e case proving re-entrancy: from inside an `on_echo_fired`
handler the consumer issues another request to the library, carrying data
taken from the event, and gets a correct response back.

The handler runs on the FFI thread with the event-registry lock held, so the
test documents and exercises the only safe shape: an *async* request. A
synchronous call from the handler would self-deadlock (the FFI thread is busy
running the handler), and add/removeEventListener would deadlock on the
registry lock. The async request merely queues on the FFI channel and is
drained once the handler returns; its future is moved out and resolved on the
main thread. A one-shot guard avoids the echo->event->echo storm (echo
re-fires the event). Timeouts turn any deadlock regression into a failure
rather than a hang.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 19:56:43 +02:00
..
2026-05-27 22:26:39 +02:00