Files
Maksym LyskovandKamil Myśliwiec 2786cbeb93 fix(core): resolve request-scoped forward refs for concurrent requests (#18200)
* fix(core): resolve request-scoped forward refs for concurrent requests

Since #18186, concurrent requests that resolve a two-sided forwardRef()
pair of request-scoped providers can fail with a false
CircularDependencyException. Each load creates its own settlement
signal, but it was only stored on the shared wrapper, so the pending
check, the recorded cycle edges and the deferred-load failure used the
signal of whichever context loaded the wrapper last.

Each per-context instance now keeps its own signal, and the three sites
use the signals of the context being resolved.

* perf(core): record settlement edges with a small class

An object literal with a getter on every unresolved edge made resolving request-scoped chains about 12% slower. Also cover resolving both sides of a one-sided cycle at once.

---------

Co-authored-by: Kamil Myśliwiec <mail@kamilmysliwiec.com>
2026-10-20 08:52:23 +02:00
..