Skip to content

Commit

Permalink
Don't log onRecoverableError if the current commit fail (#28665)
Browse files Browse the repository at this point in the history
We didn't recover after all.

Currently we might log a recoverable error in the recovery pass. E.g.
the SSR server had an error. Then the client component fails to render
which errors again. This ends up double logging.

So if we fail to actually complete a fully successful commit, we ignore
any recoverable errors because we'll get real errors logged.

It's possible that this might cover up some other error that happened at
the same time.

DiffTrain build for commit e10a7b5.
  • Loading branch information
sebmarkbage committed Mar 28, 2024
1 parent 853d994 commit 84addaa
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d0aa2e6a0e8da06520b3955d1e4ff347>>
* @generated SignedSource<<398013076b718065eff718ae9cda9bc9>>
*/

"use strict";
Expand Down Expand Up @@ -22614,7 +22614,15 @@ if (__DEV__) {
break;
}

case RootErrored:
case RootErrored: {
// This render errored. Ignore any recoverable errors because we weren't actually
// able to recover. Instead, whatever the final errors were is the ones we log.
// This ensures that we only log the actual client side error if it's just a plain
// error thrown from a component on the server and the client.
workInProgressRootRecoverableErrors = null;
break;
}

case RootSuspended:
case RootCompleted: {
break;
Expand Down Expand Up @@ -26232,7 +26240,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-canary-7773ba64";
var ReactVersion = "19.0.0-canary-32f0e114";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<fbc62bfe200b9d9ebe7f7d11c5ded593>>
* @generated SignedSource<<0ee47dc3b016f4afd98141a3877b7155>>
*/

"use strict";
Expand Down Expand Up @@ -7543,6 +7543,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
}
break;
case 2:
workInProgressRootRecoverableErrors = null;
break;
case 3:
case 5:
break;
Expand Down Expand Up @@ -9183,7 +9185,7 @@ var devToolsConfig$jscomp$inline_1010 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-91633fbe",
version: "19.0.0-canary-c99426f3",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1198 = {
Expand Down Expand Up @@ -9214,7 +9216,7 @@ var internals$jscomp$inline_1198 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-91633fbe"
reconcilerVersion: "19.0.0-canary-c99426f3"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1199 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<662d561a421c36554758f8e6e23d952c>>
* @generated SignedSource<<41c82c8e66afe030207944ff087399ac>>
*/

"use strict";
Expand Down Expand Up @@ -7885,6 +7885,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
}
break;
case 2:
workInProgressRootRecoverableErrors = null;
break;
case 3:
case 5:
break;
Expand Down Expand Up @@ -9609,7 +9611,7 @@ var devToolsConfig$jscomp$inline_1053 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-b7977e30",
version: "19.0.0-canary-58a5689a",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1239 = {
Expand Down Expand Up @@ -9640,7 +9642,7 @@ var internals$jscomp$inline_1239 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-b7977e30"
reconcilerVersion: "19.0.0-canary-58a5689a"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1240 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a0537160771bafae90c6fd3154eeead2f2c903e7
e10a7b5cd541882a78ff659147c1a0294413ccb0
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<aa8c8ecbed2d92e2e15f4de2c4919cff>>
* @generated SignedSource<<9c81454fac04a284791d0ad56825d16e>>
*/

"use strict";
Expand Down Expand Up @@ -26645,7 +26645,15 @@ to return true:wantsResponderID| |
break;
}

case RootErrored:
case RootErrored: {
// This render errored. Ignore any recoverable errors because we weren't actually
// able to recover. Instead, whatever the final errors were is the ones we log.
// This ensures that we only log the actual client side error if it's just a plain
// error thrown from a component on the server and the client.
workInProgressRootRecoverableErrors = null;
break;
}

case RootSuspended:
case RootCompleted: {
break;
Expand Down Expand Up @@ -30563,7 +30571,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "19.0.0-canary-61da7430";
var ReactVersion = "19.0.0-canary-1f40d31c";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<831b87dba7ff1bcc6c13121b5a09085a>>
* @generated SignedSource<<d1e551744163659d35d40bd04a925d41>>
*/

"use strict";
Expand Down Expand Up @@ -9137,6 +9137,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
}
break;
case 2:
workInProgressRootRecoverableErrors = null;
break;
case 3:
case 5:
break;
Expand Down Expand Up @@ -10636,7 +10638,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1105 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-canary-9deee096",
version: "19.0.0-canary-369e456c",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10679,7 +10681,7 @@ var internals$jscomp$inline_1342 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-9deee096"
reconcilerVersion: "19.0.0-canary-369e456c"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1343 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<244937dc229d1c275651498c5cc072e4>>
* @generated SignedSource<<1559aa190bc5f176834018f226327de0>>
*/

"use strict";
Expand Down Expand Up @@ -9669,6 +9669,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
}
break;
case 2:
workInProgressRootRecoverableErrors = null;
break;
case 3:
case 5:
break;
Expand Down Expand Up @@ -11343,7 +11345,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1187 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-canary-02645df6",
version: "19.0.0-canary-042f4f16",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11399,7 +11401,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-02645df6"
reconcilerVersion: "19.0.0-canary-042f4f16"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2404257a9486a252ec409c8c85f8f4d3>>
* @generated SignedSource<<c68a27d19a317e5a7b99950cb7e7c671>>
*/

"use strict";
Expand Down Expand Up @@ -27085,7 +27085,15 @@ to return true:wantsResponderID| |
break;
}

case RootErrored:
case RootErrored: {
// This render errored. Ignore any recoverable errors because we weren't actually
// able to recover. Instead, whatever the final errors were is the ones we log.
// This ensures that we only log the actual client side error if it's just a plain
// error thrown from a component on the server and the client.
workInProgressRootRecoverableErrors = null;
break;
}

case RootSuspended:
case RootCompleted: {
break;
Expand Down Expand Up @@ -31003,7 +31011,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "19.0.0-canary-ddc2e0d8";
var ReactVersion = "19.0.0-canary-91643e90";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<0c190283ee39757ac0fe599741488227>>
* @generated SignedSource<<96c8efbd3025d48af64a0646f425c765>>
*/

"use strict";
Expand Down Expand Up @@ -9346,6 +9346,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
}
break;
case 2:
workInProgressRootRecoverableErrors = null;
break;
case 3:
case 5:
break;
Expand Down Expand Up @@ -10852,7 +10854,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1172 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "19.0.0-canary-48885add",
version: "19.0.0-canary-f4c7a68d",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10895,7 +10897,7 @@ var internals$jscomp$inline_1423 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-48885add"
reconcilerVersion: "19.0.0-canary-f4c7a68d"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1424 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<3e69b54c3deb3830ded1e06cc2837e8d>>
* @generated SignedSource<<747a3fcb345e723e898836c3648fe48a>>
*/

"use strict";
Expand Down Expand Up @@ -9879,6 +9879,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
}
break;
case 2:
workInProgressRootRecoverableErrors = null;
break;
case 3:
case 5:
break;
Expand Down Expand Up @@ -11560,7 +11562,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1254 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "19.0.0-canary-97d95438",
version: "19.0.0-canary-7a0cbc16",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11616,7 +11618,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-97d95438"
reconcilerVersion: "19.0.0-canary-7a0cbc16"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit 84addaa

Please sign in to comment.