From 84addaa3ed5ee04001a248b01d46fba9ce384e49 Mon Sep 17 00:00:00 2001 From: sebmarkbage Date: Thu, 28 Mar 2024 14:44:26 +0000 Subject: [PATCH] Don't log onRecoverableError if the current commit fail (#28665) 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 https://github.com/facebook/react/commit/e10a7b5cd541882a78ff659147c1a0294413ccb0. --- .../cjs/ReactTestRenderer-dev.js | 14 +++++++++++--- .../cjs/ReactTestRenderer-prod.js | 8 +++++--- .../cjs/ReactTestRenderer-profiling.js | 8 +++++--- .../Libraries/Renderer/REVISION | 2 +- .../Renderer/implementations/ReactFabric-dev.fb.js | 14 +++++++++++--- .../implementations/ReactFabric-prod.fb.js | 8 +++++--- .../implementations/ReactFabric-profiling.fb.js | 8 +++++--- .../implementations/ReactNativeRenderer-dev.fb.js | 14 +++++++++++--- .../implementations/ReactNativeRenderer-prod.fb.js | 8 +++++--- .../ReactNativeRenderer-profiling.fb.js | 8 +++++--- 10 files changed, 64 insertions(+), 28 deletions(-) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js index 668245581a5e2..8d03e50213746 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<398013076b718065eff718ae9cda9bc9>> */ "use strict"; @@ -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; @@ -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. diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js index 85124ace4ce38..e354f5e78a3d3 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<0ee47dc3b016f4afd98141a3877b7155>> */ "use strict"; @@ -7543,6 +7543,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } break; case 2: + workInProgressRootRecoverableErrors = null; + break; case 3: case 5: break; @@ -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 = { @@ -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__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 471a4bbee1a29..c43daa634cf83 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<662d561a421c36554758f8e6e23d952c>> + * @generated SignedSource<<41c82c8e66afe030207944ff087399ac>> */ "use strict"; @@ -7885,6 +7885,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } break; case 2: + workInProgressRootRecoverableErrors = null; + break; case 3: case 5: break; @@ -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 = { @@ -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__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index 176d83a494b94..a3380f6cacc33 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -a0537160771bafae90c6fd3154eeead2f2c903e7 +e10a7b5cd541882a78ff659147c1a0294413ccb0 diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index e23aa5a086955..ea31b73e4ef04 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<9c81454fac04a284791d0ad56825d16e>> */ "use strict"; @@ -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; @@ -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, diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 8fba4f69dbde3..d0a353ed7a5cf 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<831b87dba7ff1bcc6c13121b5a09085a>> + * @generated SignedSource<> */ "use strict"; @@ -9137,6 +9137,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } break; case 2: + workInProgressRootRecoverableErrors = null; + break; case 3: case 5: break; @@ -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, @@ -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__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index f8fbdf83fe33b..c12b2c2f70f1a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<244937dc229d1c275651498c5cc072e4>> + * @generated SignedSource<<1559aa190bc5f176834018f226327de0>> */ "use strict"; @@ -9669,6 +9669,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } break; case 2: + workInProgressRootRecoverableErrors = null; + break; case 3: case 5: break; @@ -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, @@ -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( diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 654fe5f687df6..45fe9e69ab08a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<2404257a9486a252ec409c8c85f8f4d3>> + * @generated SignedSource<> */ "use strict"; @@ -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; @@ -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, diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index 1593b2972f753..61fa08aef6d01 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<0c190283ee39757ac0fe599741488227>> + * @generated SignedSource<<96c8efbd3025d48af64a0646f425c765>> */ "use strict"; @@ -9346,6 +9346,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } break; case 2: + workInProgressRootRecoverableErrors = null; + break; case 3: case 5: break; @@ -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, @@ -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__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index 5694d422f5e08..c0db2c5aa3d38 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<3e69b54c3deb3830ded1e06cc2837e8d>> + * @generated SignedSource<<747a3fcb345e723e898836c3648fe48a>> */ "use strict"; @@ -9879,6 +9879,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } break; case 2: + workInProgressRootRecoverableErrors = null; + break; case 3: case 5: break; @@ -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, @@ -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) {