Skip to content

Commit 8cdc1ea

Browse files
sebmarkbageeps1lon
authored andcommitted
Call moveDebugInfoFromChunkToInnerValue if we initialize with no listeners
wakeChunk doesn't get called if we initialize a value without any listeners.
1 parent f6dbd5d commit 8cdc1ea

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/react-client/src/ReactFlightClient.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ function createErrorChunk<T>(
501501
}
502502

503503
function moveDebugInfoFromChunkToInnerValue<T>(
504-
chunk: InitializedChunk<T>,
504+
chunk: InitializedChunk<T> | InitializedStreamChunk<any>,
505505
value: T,
506506
): void {
507507
// Remove the debug info from the initialized chunk, and add it to the inner
@@ -1570,6 +1570,10 @@ function fulfillReference(
15701570
initializedChunk.reason = handler.reason; // Used by streaming chunks
15711571
if (resolveListeners !== null) {
15721572
wakeChunk(resolveListeners, handler.value, initializedChunk);
1573+
} else {
1574+
if (__DEV__) {
1575+
moveDebugInfoFromChunkToInnerValue(initializedChunk, handler.value);
1576+
}
15731577
}
15741578
}
15751579
}
@@ -1819,6 +1823,10 @@ function loadServerReference<A: Iterable<any>, T>(
18191823
initializedChunk.value = handler.value;
18201824
if (resolveListeners !== null) {
18211825
wakeChunk(resolveListeners, handler.value, initializedChunk);
1826+
} else {
1827+
if (__DEV__) {
1828+
moveDebugInfoFromChunkToInnerValue(initializedChunk, handler.value);
1829+
}
18221830
}
18231831
}
18241832
}
@@ -3048,6 +3056,10 @@ function resolveStream<T: ReadableStream | $AsyncIterable<any, any, void>>(
30483056
resolvedChunk.reason = controller;
30493057
if (resolveListeners !== null) {
30503058
wakeChunk(resolveListeners, chunk.value, (chunk: any));
3059+
} else {
3060+
if (__DEV__) {
3061+
moveDebugInfoFromChunkToInnerValue(resolvedChunk, stream);
3062+
}
30513063
}
30523064
}
30533065

0 commit comments

Comments
 (0)