Commit de8e005
authored
[Fizz] Fix aborts during resumed rendering (react#36584)
Stacked on react#36583
Fizz previously identified a task that was rendering during an abort by
marking its blocked Segment as `RENDERING`. This does not work for
resumed replay tasks because they do not have a Segment, so an abort
during replay could eagerly abort the task before it unwound and then
report the internal `null` throw instead of the abort reason.
Track the task currently executing on the Request so aborting can leave
the in-flight task to unwind through its normal error path for both
render and replay tasks. Since this replaces the only purpose of the
Segment `RENDERING` status, remove that status and its associated
bookkeeping.
When resumed work unwinds after aborting, use the request's abort reason
in the replay catch paths so aborting while replaying a prerendered tree
or while rendering a resumed segment reports the meaningful abort reason
instead of the internal control-flow value.1 parent ddcb58f commit de8e005
2 files changed
Lines changed: 127 additions & 16 deletions
File tree
- packages
- react-dom/src/__tests__
- react-server/src
Lines changed: 109 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
608 | 717 | | |
609 | 718 | | |
610 | 719 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
343 | 342 | | |
344 | | - | |
| 343 | + | |
345 | 344 | | |
346 | 345 | | |
347 | 346 | | |
| |||
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
| 383 | + | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
| 542 | + | |
542 | 543 | | |
543 | 544 | | |
544 | 545 | | |
| |||
1473 | 1474 | | |
1474 | 1475 | | |
1475 | 1476 | | |
1476 | | - | |
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
| |||
1548 | 1548 | | |
1549 | 1549 | | |
1550 | 1550 | | |
1551 | | - | |
1552 | | - | |
1553 | 1551 | | |
1554 | 1552 | | |
1555 | 1553 | | |
| |||
1744 | 1742 | | |
1745 | 1743 | | |
1746 | 1744 | | |
1747 | | - | |
| 1745 | + | |
1748 | 1746 | | |
| 1747 | + | |
1749 | 1748 | | |
1750 | 1749 | | |
1751 | 1750 | | |
| |||
2263 | 2262 | | |
2264 | 2263 | | |
2265 | 2264 | | |
2266 | | - | |
2267 | 2265 | | |
2268 | 2266 | | |
2269 | 2267 | | |
| |||
3161 | 3159 | | |
3162 | 3160 | | |
3163 | 3161 | | |
3164 | | - | |
| 3162 | + | |
3165 | 3163 | | |
3166 | 3164 | | |
3167 | 3165 | | |
| |||
3676 | 3674 | | |
3677 | 3675 | | |
3678 | 3676 | | |
3679 | | - | |
| 3677 | + | |
3680 | 3678 | | |
3681 | 3679 | | |
3682 | 3680 | | |
| |||
4596 | 4594 | | |
4597 | 4595 | | |
4598 | 4596 | | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
4599 | 4601 | | |
4600 | 4602 | | |
4601 | 4603 | | |
4602 | | - | |
4603 | | - | |
4604 | | - | |
4605 | | - | |
4606 | | - | |
4607 | 4604 | | |
4608 | 4605 | | |
4609 | 4606 | | |
| |||
5079 | 5076 | | |
5080 | 5077 | | |
5081 | 5078 | | |
5082 | | - | |
5083 | | - | |
| 5079 | + | |
| 5080 | + | |
5084 | 5081 | | |
5085 | 5082 | | |
5086 | 5083 | | |
| |||
5177 | 5174 | | |
5178 | 5175 | | |
5179 | 5176 | | |
| 5177 | + | |
5180 | 5178 | | |
5181 | 5179 | | |
5182 | 5180 | | |
| |||
5189 | 5187 | | |
5190 | 5188 | | |
5191 | 5189 | | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
5192 | 5193 | | |
5193 | 5194 | | |
5194 | 5195 | | |
| |||
5267 | 5268 | | |
5268 | 5269 | | |
5269 | 5270 | | |
| 5271 | + | |
5270 | 5272 | | |
5271 | 5273 | | |
5272 | 5274 | | |
| |||
0 commit comments