Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/react-client/src/ReactFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,26 @@ function waitForReference<T>(
map: (response: Response, model: any, parentObject: Object, key: string) => T,
path: Array<string>,
): T {
if (
__DEV__ &&
// TODO: This should check for the existence of the "readable" side, not the "writable".
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never pass anything into the response when there's a readable. We could maybe add a boolean just for this.

response._debugChannel === undefined
) {
if (
referencedChunk.status === PENDING &&
parentObject[0] === REACT_ELEMENT_TYPE &&
(key === '4' || key === '5')
) {
// If the parent object is an unparsed React element tuple, and this is a reference
// to the owner or debug stack. Then we expect the chunk to have been emitted earlier
// in the stream. It might be blocked on other things but chunk should no longer be pending.
// If it's still pending that suggests that it was referencing an object in the debug
// channel, but no debug channel was wired up so it's missing. In this case we can just
// drop the debug info instead of halting the whole stream.
return (null: any);
}
}

let handler: InitializationHandler;
if (initializingHandler) {
handler = initializingHandler;
Expand Down
Loading