Skip to content

Commit ee68b32

Browse files
committed
Fix: Errors should not escape a hidden Activity (#35074)
If an error is thrown inside a hidden Activity, it should not escape into the visible part of the UI. Conceptually, a hidden Activity boundary is not part of the current UI; it's the same as an unmounted tree, except for the fact that the state will be restored if it's later revealed. Fixes: - #35073 DiffTrain build for [717e708](717e708)
1 parent be8434b commit ee68b32

34 files changed

+306
-230
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fa50caf5f84bb8976aa1dbff7f15a821e44e7af7
1+
717e70843e68db648d2fc75c57d1a61465a9f7f9
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fa50caf5f84bb8976aa1dbff7f15a821e44e7af7
1+
717e70843e68db648d2fc75c57d1a61465a9f7f9

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-fa50caf5-20251107";
1502+
exports.version = "19.3.0-www-classic-717e7084-20251107";
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-fa50caf5-20251107";
1502+
exports.version = "19.3.0-www-modern-717e7084-20251107";
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-fa50caf5-20251107";
609+
exports.version = "19.3.0-www-classic-717e7084-20251107";

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-fa50caf5-20251107";
609+
exports.version = "19.3.0-www-modern-717e7084-20251107";

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-fa50caf5-20251107";
613+
exports.version = "19.3.0-www-classic-717e7084-20251107";
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-fa50caf5-20251107";
613+
exports.version = "19.3.0-www-modern-717e7084-20251107";
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: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7449,15 +7449,15 @@ __DEV__ &&
74497449
!1
74507450
);
74517451
case 1:
7452+
sourceFiber = returnFiber.type;
7453+
error = returnFiber.stateNode;
74527454
if (
7453-
((sourceFiber = returnFiber.type),
7454-
(error = returnFiber.stateNode),
74557455
0 === (returnFiber.flags & 128) &&
7456-
("function" === typeof sourceFiber.getDerivedStateFromError ||
7457-
(null !== error &&
7458-
"function" === typeof error.componentDidCatch &&
7459-
(null === legacyErrorBoundariesThatAlreadyFailed ||
7460-
!legacyErrorBoundariesThatAlreadyFailed.has(error)))))
7456+
("function" === typeof sourceFiber.getDerivedStateFromError ||
7457+
(null !== error &&
7458+
"function" === typeof error.componentDidCatch &&
7459+
(null === legacyErrorBoundariesThatAlreadyFailed ||
7460+
!legacyErrorBoundariesThatAlreadyFailed.has(error))))
74617461
)
74627462
return (
74637463
(returnFiber.flags |= 65536),
@@ -7473,6 +7473,10 @@ __DEV__ &&
74737473
enqueueCapturedUpdate(returnFiber, rootRenderLanes),
74747474
!1
74757475
);
7476+
break;
7477+
case 22:
7478+
if (null !== returnFiber.memoizedState)
7479+
return (returnFiber.flags |= 65536), !1;
74767480
}
74777481
returnFiber = returnFiber.return;
74787482
} while (null !== returnFiber);
@@ -20441,10 +20445,10 @@ __DEV__ &&
2044120445
(function () {
2044220446
var internals = {
2044320447
bundleType: 1,
20444-
version: "19.3.0-www-classic-fa50caf5-20251107",
20448+
version: "19.3.0-www-classic-717e7084-20251107",
2044520449
rendererPackageName: "react-art",
2044620450
currentDispatcherRef: ReactSharedInternals,
20447-
reconcilerVersion: "19.3.0-www-classic-fa50caf5-20251107"
20451+
reconcilerVersion: "19.3.0-www-classic-717e7084-20251107"
2044820452
};
2044920453
internals.overrideHookState = overrideHookState;
2045020454
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20479,7 +20483,7 @@ __DEV__ &&
2047920483
exports.Shape = Shape;
2048020484
exports.Surface = Surface;
2048120485
exports.Text = Text;
20482-
exports.version = "19.3.0-www-classic-fa50caf5-20251107";
20486+
exports.version = "19.3.0-www-classic-717e7084-20251107";
2048320487
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2048420488
"function" ===
2048520489
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7355,15 +7355,15 @@ __DEV__ &&
73557355
!1
73567356
);
73577357
case 1:
7358+
sourceFiber = returnFiber.type;
7359+
error = returnFiber.stateNode;
73587360
if (
7359-
((sourceFiber = returnFiber.type),
7360-
(error = returnFiber.stateNode),
73617361
0 === (returnFiber.flags & 128) &&
7362-
("function" === typeof sourceFiber.getDerivedStateFromError ||
7363-
(null !== error &&
7364-
"function" === typeof error.componentDidCatch &&
7365-
(null === legacyErrorBoundariesThatAlreadyFailed ||
7366-
!legacyErrorBoundariesThatAlreadyFailed.has(error)))))
7362+
("function" === typeof sourceFiber.getDerivedStateFromError ||
7363+
(null !== error &&
7364+
"function" === typeof error.componentDidCatch &&
7365+
(null === legacyErrorBoundariesThatAlreadyFailed ||
7366+
!legacyErrorBoundariesThatAlreadyFailed.has(error))))
73677367
)
73687368
return (
73697369
(returnFiber.flags |= 65536),
@@ -7379,6 +7379,10 @@ __DEV__ &&
73797379
enqueueCapturedUpdate(returnFiber, rootRenderLanes),
73807380
!1
73817381
);
7382+
break;
7383+
case 22:
7384+
if (null !== returnFiber.memoizedState)
7385+
return (returnFiber.flags |= 65536), !1;
73827386
}
73837387
returnFiber = returnFiber.return;
73847388
} while (null !== returnFiber);
@@ -20212,10 +20216,10 @@ __DEV__ &&
2021220216
(function () {
2021320217
var internals = {
2021420218
bundleType: 1,
20215-
version: "19.3.0-www-modern-fa50caf5-20251107",
20219+
version: "19.3.0-www-modern-717e7084-20251107",
2021620220
rendererPackageName: "react-art",
2021720221
currentDispatcherRef: ReactSharedInternals,
20218-
reconcilerVersion: "19.3.0-www-modern-fa50caf5-20251107"
20222+
reconcilerVersion: "19.3.0-www-modern-717e7084-20251107"
2021920223
};
2022020224
internals.overrideHookState = overrideHookState;
2022120225
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20250,7 +20254,7 @@ __DEV__ &&
2025020254
exports.Shape = Shape;
2025120255
exports.Surface = Surface;
2025220256
exports.Text = Text;
20253-
exports.version = "19.3.0-www-modern-fa50caf5-20251107";
20257+
exports.version = "19.3.0-www-modern-717e7084-20251107";
2025420258
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2025520259
"function" ===
2025620260
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)