Commit bd7f4a0
authored
Fix sloppy factoring in
* Warn if `finishedLanes` is empty in commit phase
See #21233 for context.
* Fix sloppy factoring when assigning finishedLanes
`finishedLanes` is assigned in `performSyncWorkOnRoot` and
`performSyncWorkOnRoot`. It's meant to represent whichever lanes we
used to render, but because of some sloppy factoring, it can sometimes
equal `NoLanes`.
The fixes are:
- Always check if the lanes are not `NoLanes` before entering the work
loop. There was a branch where this wasn't always true.
- In `performSyncWorkOnRoot`, don't assume the next lanes are sync; the
priority may have changed, or they may have been flushed by a
previous task.
- Don't re-assign the `lanes` variable (the one that gets assigned to
`finishedLanes` until right before we enter the work loop, so that it
is always corresponds to the newest complete root.performSyncWorkOnRoot (#21246)1 parent 7812003 commit bd7f4a0
File tree
4 files changed
+82
-50
lines changed- packages/react-reconciler/src
4 files changed
+82
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | 617 | | |
624 | 618 | | |
625 | 619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | 617 | | |
624 | 618 | | |
625 | 619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | 166 | | |
168 | 167 | | |
169 | 168 | | |
| |||
840 | 839 | | |
841 | 840 | | |
842 | 841 | | |
843 | | - | |
844 | | - | |
845 | | - | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1015 | 1026 | | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1023 | 1030 | | |
1024 | 1031 | | |
| 1032 | + | |
1025 | 1033 | | |
1026 | 1034 | | |
1027 | 1035 | | |
| |||
1039 | 1047 | | |
1040 | 1048 | | |
1041 | 1049 | | |
1042 | | - | |
1043 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1044 | 1053 | | |
1045 | 1054 | | |
1046 | 1055 | | |
| |||
1058 | 1067 | | |
1059 | 1068 | | |
1060 | 1069 | | |
1061 | | - | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
1062 | 1075 | | |
1063 | 1076 | | |
1064 | 1077 | | |
| |||
1826 | 1839 | | |
1827 | 1840 | | |
1828 | 1841 | | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
1829 | 1851 | | |
1830 | 1852 | | |
1831 | 1853 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | 166 | | |
168 | 167 | | |
169 | 168 | | |
| |||
840 | 839 | | |
841 | 840 | | |
842 | 841 | | |
843 | | - | |
844 | | - | |
845 | | - | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1015 | 1026 | | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1023 | 1030 | | |
1024 | 1031 | | |
| 1032 | + | |
1025 | 1033 | | |
1026 | 1034 | | |
1027 | 1035 | | |
| |||
1039 | 1047 | | |
1040 | 1048 | | |
1041 | 1049 | | |
1042 | | - | |
1043 | | - | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1044 | 1053 | | |
1045 | 1054 | | |
1046 | 1055 | | |
| |||
1058 | 1067 | | |
1059 | 1068 | | |
1060 | 1069 | | |
1061 | | - | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
1062 | 1075 | | |
1063 | 1076 | | |
1064 | 1077 | | |
| |||
1826 | 1839 | | |
1827 | 1840 | | |
1828 | 1841 | | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
1829 | 1851 | | |
1830 | 1852 | | |
1831 | 1853 | | |
| |||
0 commit comments