-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
More robust fix for #18515 #18535
Conversation
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.
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:
|
Details of bundled changes.Comparing: ddc4b65...942d555 react-dom
react-native-renderer
react-art
ReactDOM: size: 0.0%, gzip: 0.0% Size changes (stable) |
Details of bundled changes.Comparing: ddc4b65...942d555 react-native-renderer
react-dom
react-art
Size changes (experimental) |
root.finishedExpirationTime = expirationTime; | ||
|
||
root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.