-
Notifications
You must be signed in to change notification settings - Fork 47.6k
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
Bugfix: Fix crash when suspending in shell during useSES re-render #27199
Bugfix: Fix crash when suspending in shell during useSES re-render #27199
Conversation
This adds a regression test for a bug where, after a store mutation, the updated data causes the shell of the app to suspend. Because of how the code is factored, we're currently failing to check for this case, leading to an internal error and crash. A fix is included in the next commits.
When re-rendering due to a concurrent store mutation, we must check for the RootDidNotComplete exit status again. This fixes the test introduced in the previous commit. As a follow-up, I'm going to look into to cleaning up the places where we check the exit status, so bugs like these are less likely. I think we might be able to combine most of it into a single switch statement.
|
||
// Before B renders, mutate the store. | ||
store.set('Updated'); | ||
}); |
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.
Before the fix, the test would crash here with an internal error ("Unknown root status")
Comparing: 997f52f...c8335c5 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
@@ -957,8 +938,7 @@ export function performConcurrentWorkOnRoot( | |||
originallyAttemptedLanes, | |||
errorRetryLanes, | |||
); | |||
// We assume the tree is now consistent because we didn't yield to any | |||
// concurrent events. | |||
renderWasConcurrent = false; |
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.
This is just for clarity, right? As far as I can tell, it's not read anymore at this point.
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.
yeah :D in case a continue
gets added later in the loop or something
…27199) This adds a regression test for a bug where, after a store mutation, the updated data causes the shell of the app to suspend. When re-rendering due to a concurrent store mutation, we must check for the RootDidNotComplete exit status again. As a follow-up, I'm going to look into to cleaning up the places where we check the exit status, so bugs like these are less likely. I think we might be able to combine most of it into a single switch statement. DiffTrain build for [201becd](201becd)
Updated React from cb3404a0c to f359f9b41. ### React upstream changes - facebook/react#27191 - facebook/react#27209 - facebook/react#27199 - facebook/react#27218 - facebook/react#27217 - facebook/react#27212
…acebook#27199) This adds a regression test for a bug where, after a store mutation, the updated data causes the shell of the app to suspend. When re-rendering due to a concurrent store mutation, we must check for the RootDidNotComplete exit status again. As a follow-up, I'm going to look into to cleaning up the places where we check the exit status, so bugs like these are less likely. I think we might be able to combine most of it into a single switch statement.
…27199) This adds a regression test for a bug where, after a store mutation, the updated data causes the shell of the app to suspend. When re-rendering due to a concurrent store mutation, we must check for the RootDidNotComplete exit status again. As a follow-up, I'm going to look into to cleaning up the places where we check the exit status, so bugs like these are less likely. I think we might be able to combine most of it into a single switch statement. DiffTrain build for commit 201becd.
This adds a regression test for a bug where, after a store mutation, the updated data causes the shell of the app to suspend.
When re-rendering due to a concurrent store mutation, we must check for the RootDidNotComplete exit status again.
As a follow-up, I'm going to look into to cleaning up the places where we check the exit status, so bugs like these are less likely. I think we might be able to combine most of it into a single switch statement.