[Fizz] Mark boundary as client rendered even if aborting fallback #21294
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The fix in 5781269 was slightly wrong. This surfaced in a legacy test. /~https://github.com/facebook/react/blob/master/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js
If a task blocking a boundary is aborted, and that boundary's fallback has pending tasks, it doesn't mean that the parent will be client rendered. Because the boundary's fallback's pending tasks might themselves be inside other boundaries and not needed to complete. So we must still mark it as client rendered in that case.
We didn't need to be this conservative because the real fix was moving the allPendingTasks decrementor. As a safety for new user space calls, I made sure to move the parentFlushed check before the recursive call.