Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More robust fix for #18515 #18535

Merged
merged 2 commits into from
Apr 8, 2020
Merged

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Apr 8, 2020

Adds a regression test for the same underlying bug as #18515 but using pings.

Test already passes, but I confirmed it fails if you revert the fix in #18515.

Also confirmed that this fix alone is sufficient to fix the bug. However, I've kept the previous fix as defense against a future regression, since we've had similar bugs around clearing Suspense timers before.

The fix is to always set nextKnownPendingLevel upon finishing a root, instead of only when it suspends.

Adds a regression test for the same underlying bug as facebook#18515 but using
pings.

Test already passes, but I confirmed it fails if you revert the fix
in facebook#18515.
@facebook-github-bot facebook-github-bot added React Core Team Opened by a member of the React Core Team CLA Signed labels Apr 8, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 8, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 942d555:

Sandbox Source
new-sun-f50si Configuration

@sizebot
Copy link

sizebot commented Apr 8, 2020

Details of bundled changes.

Comparing: ddc4b65...942d555

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.production.min.js -0.0% 0.0% 119.68 KB 119.64 KB 37.43 KB 37.43 KB NODE_PROD
react-dom-test-utils.development.js 0.0% 0.0% 75.12 KB 75.12 KB 20.1 KB 20.11 KB UMD_DEV
ReactDOMTesting-profiling.js -0.1% -0.0% 405.32 KB 404.82 KB 73.4 KB 73.38 KB FB_WWW_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.9 KB 4.9 KB 1.63 KB 1.64 KB UMD_DEV
react-dom.profiling.min.js -0.0% -0.0% 123.54 KB 123.51 KB 38.61 KB 38.61 KB NODE_PROFILING
react-dom-test-utils.production.min.js 0.0% 0.0% 13.22 KB 13.22 KB 4.89 KB 4.89 KB UMD_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.4% 1.19 KB 1.19 KB 696 B 699 B UMD_PROD
react-dom-server.node.development.js 0.0% -0.0% 147.06 KB 147.06 KB 38.88 KB 38.88 KB NODE_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 23.23 KB 23.23 KB 8.65 KB 8.65 KB NODE_PROD
ReactDOMForked-dev.js 0.0% 0.0% 1004.09 KB 1004.12 KB 222.43 KB 222.45 KB FB_WWW_DEV
ReactDOMForked-prod.js -0.1% -0.0% 421.81 KB 421.26 KB 75.76 KB 75.74 KB FB_WWW_PROD
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 5.16 KB 5.16 KB 1.69 KB 1.69 KB NODE_DEV
react-dom.development.js 0.0% 0.0% 902.35 KB 902.37 KB 198.12 KB 198.16 KB UMD_DEV
ReactDOMForked-profiling.js -0.1% -0.0% 432.69 KB 432.14 KB 77.63 KB 77.62 KB FB_WWW_PROFILING
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.5% 1.16 KB 1.16 KB 658 B 661 B NODE_PROD
react-dom.production.min.js -0.0% 0.0% 119.56 KB 119.52 KB 38.23 KB 38.23 KB UMD_PROD
react-dom.profiling.min.js -0.0% -0.0% 123.27 KB 123.24 KB 39.43 KB 39.43 KB UMD_PROFILING
ReactDOMTesting-dev.js 0.0% 0.0% 955.3 KB 955.33 KB 212.5 KB 212.54 KB FB_WWW_DEV
react-dom.development.js 0.0% 0.0% 859.03 KB 859.04 KB 195.66 KB 195.7 KB NODE_DEV
ReactDOMTesting-prod.js -0.1% -0.0% 405.32 KB 404.82 KB 73.4 KB 73.38 KB FB_WWW_PROD
ReactDOM-dev.js 0.0% 0.0% 1004.09 KB 1004.12 KB 222.43 KB 222.45 KB FB_WWW_DEV
ReactDOMServer-dev.js 0.0% 0.0% 157.98 KB 157.98 KB 39.92 KB 39.92 KB FB_WWW_DEV
ReactDOM-prod.js -0.1% -0.0% 421.81 KB 421.26 KB 75.76 KB 75.74 KB FB_WWW_PROD
react-dom-test-utils.development.js 0.0% 0.0% 69.97 KB 69.97 KB 19.6 KB 19.6 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.42 KB 4.42 KB 1.54 KB 1.54 KB NODE_DEV
ReactDOM-profiling.js -0.1% -0.0% 432.69 KB 432.14 KB 77.63 KB 77.62 KB FB_WWW_PROFILING
react-dom-test-utils.production.min.js 0.0% 0.0% 13.09 KB 13.09 KB 4.8 KB 4.8 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 56.1 KB 56.1 KB 13.84 KB 13.84 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1 KB 1 KB 608 B 610 B NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 9.98 KB 9.98 KB 3.35 KB 3.36 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 53.2 KB 53.2 KB 13.64 KB 13.64 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 9.73 KB 9.73 KB 3.24 KB 3.25 KB NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js 0.0% 0.0% 652.58 KB 652.61 KB 140.05 KB 140.08 KB RN_OSS_DEV
ReactNativeRenderer-prod.js -0.0% 🔺+0.1% 270.91 KB 270.83 KB 46.49 KB 46.52 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.2% -0.1% 282.74 KB 282.21 KB 48.69 KB 48.67 KB RN_OSS_PROFILING
ReactFabric-dev.js 0.0% 0.0% 634.92 KB 634.95 KB 135.74 KB 135.77 KB RN_OSS_DEV
ReactFabric-prod.js -0.0% 🔺+0.1% 263.05 KB 262.98 KB 45.01 KB 45.04 KB RN_OSS_PROD
ReactFabric-profiling.js -0.2% -0.0% 274.89 KB 274.35 KB 47.24 KB 47.21 KB RN_OSS_PROFILING

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js 0.0% 0.0% 629.23 KB 629.24 KB 132.65 KB 132.69 KB UMD_DEV
react-art.production.min.js -0.0% 0.0% 107.05 KB 107.02 KB 32.4 KB 32.4 KB UMD_PROD
react-art.development.js 0.0% 0.0% 533.79 KB 533.81 KB 115.04 KB 115.09 KB NODE_DEV
react-art.production.min.js -0.1% -0.0% 72.09 KB 72.05 KB 21.61 KB 21.6 KB NODE_PROD
ReactART-dev.js 0.0% 0.0% 595.36 KB 595.38 KB 124.79 KB 124.82 KB FB_WWW_DEV
ReactART-prod.js -0.2% -0.1% 248.35 KB 247.81 KB 41.86 KB 41.84 KB FB_WWW_PROD

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫 dangerJS against 942d555

@sizebot
Copy link

sizebot commented Apr 8, 2020

Details of bundled changes.

Comparing: ddc4b65...942d555

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-prod.js -0.0% 🔺+0.1% 270.92 KB 270.85 KB 46.5 KB 46.53 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.2% -0.1% 282.76 KB 282.22 KB 48.7 KB 48.67 KB RN_OSS_PROFILING
ReactFabric-prod.js -0.0% 🔺+0.1% 263.07 KB 262.99 KB 45.02 KB 45.05 KB RN_OSS_PROD
ReactFabric-profiling.js -0.2% -0.1% 274.9 KB 274.37 KB 47.25 KB 47.22 KB RN_OSS_PROFILING
ReactFabric-dev.js 0.0% 0.0% 637.35 KB 637.38 KB 136.05 KB 136.09 KB RN_FB_DEV
ReactFabric-prod.js -0.0% 🔺+0.1% 263.22 KB 263.14 KB 45.05 KB 45.08 KB RN_FB_PROD
ReactNativeRenderer-dev.js 0.0% 0.0% 652.6 KB 652.63 KB 140.06 KB 140.09 KB RN_OSS_DEV
ReactFabric-profiling.js -0.2% -0.0% 275.05 KB 274.51 KB 47.27 KB 47.25 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js 0.0% 0.0% 655 KB 655.03 KB 140.38 KB 140.42 KB RN_FB_DEV
ReactNativeRenderer-prod.js -0.0% 🔺+0.1% 271.07 KB 270.99 KB 46.53 KB 46.56 KB RN_FB_PROD
ReactNativeRenderer-profiling.js -0.2% -0.1% 282.9 KB 282.36 KB 48.73 KB 48.7 KB RN_FB_PROFILING
ReactFabric-dev.js 0.0% 0.0% 634.94 KB 634.96 KB 135.74 KB 135.77 KB RN_OSS_DEV

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-server.browser.development.js 0.0% 0.0% 156.59 KB 156.59 KB 39.58 KB 39.58 KB UMD_DEV
react-dom.profiling.min.js -0.0% 0.0% 127.81 KB 127.78 KB 39.83 KB 39.84 KB NODE_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.91 KB 4.91 KB 1.64 KB 1.64 KB UMD_DEV
ReactDOM-dev.js 0.0% 0.0% 976.21 KB 976.24 KB 216.43 KB 216.46 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1.2 KB 1.2 KB 704 B 706 B UMD_PROD
ReactDOM-prod.js -0.1% -0.0% 408.78 KB 408.23 KB 73.87 KB 73.86 KB FB_WWW_PROD
ReactDOM-profiling.js -0.1% -0.0% 419.6 KB 419.05 KB 75.71 KB 75.69 KB FB_WWW_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.43 KB 4.43 KB 1.54 KB 1.55 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1.02 KB 1.02 KB 616 B 618 B NODE_PROD
react-dom-test-utils.development.js 0.0% 0.0% 75.14 KB 75.14 KB 20.11 KB 20.11 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 13.23 KB 13.23 KB 4.9 KB 4.9 KB UMD_PROD
ReactDOMTesting-dev.js 0.0% 0.0% 928.75 KB 928.78 KB 206.89 KB 206.92 KB FB_WWW_DEV
ReactDOMTesting-prod.js -0.1% -0.0% 393.37 KB 392.87 KB 71.61 KB 71.6 KB FB_WWW_PROD
react-dom-test-utils.development.js 0.0% 0.0% 69.98 KB 69.98 KB 19.61 KB 19.61 KB NODE_DEV
ReactDOMTesting-profiling.js -0.1% -0.0% 393.37 KB 392.87 KB 71.61 KB 71.6 KB FB_WWW_PROFILING
react-dom-server.node.development.js 0.0% 0.0% 148.58 KB 148.58 KB 39.1 KB 39.1 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 13.1 KB 13.1 KB 4.81 KB 4.81 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% 0.0% 23.69 KB 23.69 KB 8.72 KB 8.72 KB NODE_PROD
react-dom-server.browser.development.js 0.0% 0.0% 147.36 KB 147.36 KB 38.84 KB 38.84 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 23.28 KB 23.28 KB 8.56 KB 8.57 KB NODE_PROD
react-dom.development.js 0.0% 0.0% 932.18 KB 932.2 KB 203.41 KB 203.44 KB UMD_DEV
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 56.11 KB 56.11 KB 13.85 KB 13.85 KB UMD_DEV
react-dom.production.min.js -0.0% 0.0% 123.64 KB 123.6 KB 39.38 KB 39.38 KB UMD_PROD
ReactDOMForked-dev.js 0.0% 0.0% 976.21 KB 976.24 KB 216.43 KB 216.46 KB FB_WWW_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10 KB 10 KB 3.36 KB 3.36 KB UMD_PROD
ReactDOMServer-dev.js 0.0% 0.0% 154.48 KB 154.48 KB 38.97 KB 38.97 KB FB_WWW_DEV
react-dom.profiling.min.js -0.0% 0.0% 127.46 KB 127.43 KB 40.64 KB 40.64 KB UMD_PROFILING
ReactDOMForked-prod.js -0.1% -0.0% 408.78 KB 408.23 KB 73.87 KB 73.86 KB FB_WWW_PROD
ReactDOMServer-prod.js 0.0% 0.0% 52.56 KB 52.56 KB 12.68 KB 12.68 KB FB_WWW_PROD
react-dom.development.js 0.0% 0.0% 887.62 KB 887.63 KB 200.92 KB 200.96 KB NODE_DEV
ReactDOMForked-profiling.js -0.1% -0.0% 419.6 KB 419.05 KB 75.71 KB 75.69 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 53.21 KB 53.21 KB 13.65 KB 13.65 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 5.18 KB 5.18 KB 1.7 KB 1.7 KB NODE_DEV
react-dom.production.min.js -0.0% 0.0% 123.83 KB 123.79 KB 38.59 KB 38.59 KB NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 9.75 KB 9.75 KB 3.25 KB 3.26 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.3% 1.17 KB 1.17 KB 667 B 669 B NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js 0.0% 0.0% 649.5 KB 649.51 KB 136.34 KB 136.39 KB UMD_DEV
react-art.production.min.js -0.0% 0.0% 109.66 KB 109.63 KB 33.05 KB 33.07 KB UMD_PROD
react-art.development.js 0.0% 0.0% 553.26 KB 553.28 KB 118.81 KB 118.87 KB NODE_DEV
react-art.production.min.js -0.0% 🔺+0.1% 74.64 KB 74.61 KB 22.24 KB 22.25 KB NODE_PROD
ReactART-dev.js 0.0% 0.0% 585.29 KB 585.32 KB 122.81 KB 122.84 KB FB_WWW_DEV
ReactART-prod.js -0.2% -0.1% 240.78 KB 240.24 KB 40.6 KB 40.57 KB FB_WWW_PROD

Size changes (experimental)

Generated by 🚫 dangerJS against 942d555

root.finishedExpirationTime = expirationTime;

root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
Copy link
Collaborator

@gaearon gaearon Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth writing a regression test that would fail if this and the defensive safeguard were removed? Looks like the new test covers the Concurrent render only. Not sure if this matters.

Copy link
Collaborator Author

@acdlite acdlite Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff view is misleading because of collapsed sections. This line is the sync path. The concurrent path is here: https://github.com/facebook/react/pull/18535/files#diff-63c455475b8566c10993b2daa2c3211bR685

The test in #18515 covers the sync path because the discrete update is expired but I can add another test since that one happens to be fixed by the other change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants