Repository navigation
Commit 07dde64
authored
[Fizz] Postpone a task aborted while rendering from where it started (#37710)
## Summary
Fixes #37709
When a prerender is aborted while a retried render task is on the stack,
`retryRenderTask` resets the segment to where the attempt started, but
`task.keyPath` and `task.childIndex` are left at the innermost child
that was rendering. `abortUnwoundTask` then postpones the task at that
child's slot under its parent element, and the resume renders only that
child into the boundary's segment.
This restores the key path and child index the attempt started from
before finishing the abort, so the postponed hole covers the whole
discarded attempt. `task.node` stays as is, since DEV async debug info
reads it for the owner stack.
## How did you test this change?
The first commit adds a test to `ReactDOMFizzStaticBrowser-test` that
aborts the prerender from a component rendered by a retried task and
resumes it, asserting the current output (`<div>World</div>`). The
second commit is the fix and updates the assertion to the whole
`<section>`.
`yarn test packages/react-dom/src/__tests__/ReactDOMFizz
packages/react-server` passes with and without `-r=experimental`. With
`--prod`, `ReactServer › has Owner Stacks in DEV when aborted` fails the
same way on main. Prettier, ESLint and `yarn flow dom-node` are clean.1 parent 9f2e1f8 commit 07dde64
2 files changed
Lines changed: 72 additions & 0 deletions
File tree
- packages
- react-dom/src/__tests__
- react-server/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
864 | 932 | | |
865 | 933 | | |
866 | 934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5368 | 5368 | | |
5369 | 5369 | | |
5370 | 5370 | | |
| 5371 | + | |
| 5372 | + | |
5371 | 5373 | | |
5372 | 5374 | | |
5373 | 5375 | | |
| |||
5414 | 5416 | | |
5415 | 5417 | | |
5416 | 5418 | | |
| 5419 | + | |
| 5420 | + | |
5417 | 5421 | | |
5418 | 5422 | | |
5419 | 5423 | | |
| |||
0 commit comments