Skip to content
/ lib-react Public
forked from facebook/react

Commit 53d76f9

Browse files
committed
Improve cyclic thenable detection in ReactFlightReplyServer (facebook#35369)
## Summary This PR improves cyclic thenable detection in `ReactFlightReplyServer.js`. Fixes facebook#35368. The previous fix only detected direct self-references (`inspectedValue === chunk`) and relied on the `cycleProtection` counter to eventually bail out of longer cycles. This change keeps the existing MAX_THENABLE_CYCLE_DEPTH ($1000$) `cycleProtection` cap as a hard guardrail and adds a visited set so that we can detect self-cycles and multi-node cycles as soon as any `ReactPromise` is revisited and while still bounding the amount of work we do for deep acyclic chains via `cycleProtection`. ## How did you test this change? - Ran the existing test suite for the server renderer: ```bash yarn test react-server yarn test --prod react-server yarn flow dom-node yarn linc ``` --------- Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de> DiffTrain build for [b731fe2](facebook@b731fe2)
1 parent 10b8e71 commit 53d76f9

34 files changed

+130
-258
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
454fc41fc7d50f8abbcfb9595b01e8ea8bfcc265
1+
b731fe28cc492cb36c51c89866f5b63a3ffae2aa
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
454fc41fc7d50f8abbcfb9595b01e8ea8bfcc265
1+
b731fe28cc492cb36c51c89866f5b63a3ffae2aa

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ __DEV__ &&
14991499
exports.useTransition = function () {
15001500
return resolveDispatcher().useTransition();
15011501
};
1502-
exports.version = "19.3.0-www-classic-454fc41f-20251217";
1502+
exports.version = "19.3.0-www-classic-b731fe28-20251217";
15031503
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15041504
"function" ===
15051505
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ __DEV__ &&
14991499
exports.useTransition = function () {
15001500
return resolveDispatcher().useTransition();
15011501
};
1502-
exports.version = "19.3.0-www-modern-454fc41f-20251217";
1502+
exports.version = "19.3.0-www-modern-b731fe28-20251217";
15031503
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15041504
"function" ===
15051505
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,4 +606,4 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.3.0-www-classic-454fc41f-20251217";
609+
exports.version = "19.3.0-www-classic-b731fe28-20251217";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,4 +606,4 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.3.0-www-modern-454fc41f-20251217";
609+
exports.version = "19.3.0-www-modern-b731fe28-20251217";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-classic-454fc41f-20251217";
613+
exports.version = "19.3.0-www-classic-b731fe28-20251217";
614614
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
615615
"function" ===
616616
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-modern-454fc41f-20251217";
613+
exports.version = "19.3.0-www-modern-b731fe28-20251217";
614614
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
615615
"function" ===
616616
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20468,10 +20468,10 @@ __DEV__ &&
2046820468
(function () {
2046920469
var internals = {
2047020470
bundleType: 1,
20471-
version: "19.3.0-www-classic-454fc41f-20251217",
20471+
version: "19.3.0-www-classic-b731fe28-20251217",
2047220472
rendererPackageName: "react-art",
2047320473
currentDispatcherRef: ReactSharedInternals,
20474-
reconcilerVersion: "19.3.0-www-classic-454fc41f-20251217"
20474+
reconcilerVersion: "19.3.0-www-classic-b731fe28-20251217"
2047520475
};
2047620476
internals.overrideHookState = overrideHookState;
2047720477
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20506,7 +20506,7 @@ __DEV__ &&
2050620506
exports.Shape = Shape;
2050720507
exports.Surface = Surface;
2050820508
exports.Text = Text;
20509-
exports.version = "19.3.0-www-classic-454fc41f-20251217";
20509+
exports.version = "19.3.0-www-classic-b731fe28-20251217";
2051020510
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2051120511
"function" ===
2051220512
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20239,10 +20239,10 @@ __DEV__ &&
2023920239
(function () {
2024020240
var internals = {
2024120241
bundleType: 1,
20242-
version: "19.3.0-www-modern-454fc41f-20251217",
20242+
version: "19.3.0-www-modern-b731fe28-20251217",
2024320243
rendererPackageName: "react-art",
2024420244
currentDispatcherRef: ReactSharedInternals,
20245-
reconcilerVersion: "19.3.0-www-modern-454fc41f-20251217"
20245+
reconcilerVersion: "19.3.0-www-modern-b731fe28-20251217"
2024620246
};
2024720247
internals.overrideHookState = overrideHookState;
2024820248
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20277,7 +20277,7 @@ __DEV__ &&
2027720277
exports.Shape = Shape;
2027820278
exports.Surface = Surface;
2027920279
exports.Text = Text;
20280-
exports.version = "19.3.0-www-modern-454fc41f-20251217";
20280+
exports.version = "19.3.0-www-modern-b731fe28-20251217";
2028120281
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2028220282
"function" ===
2028320283
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)