SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 0 JavaScript

[Flight] Insert an extra await node for awaiting on the promise returned by then callback (#33713)

When a `.then()` callback returns another Promise, there's effectively
another "await" on that Promise that happens in the internals but that
was not modeled. In effect the Promise returned by `.then()` is blocked
on both the original Promise AND the promise returned by the callback.

This models that by cloning the original node and treat that as the
await on the original Promise. Then we use the existing Node to await
the new Promise but its "previous" points to the clone. That way we have
a forked node that awaits both.

---------

Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
S
Sebastian Markbåge committed
2d7f0c425902d13617f5c02c1b7c0f2cd95cd6d9
Parent: 4aad5e4
Committed by GitHub <noreply@github.com> on 7/6/2025, 7:34:36 PM