Bugfix: Fix crash when suspending in shell during useSES re-render#27199
Merged
acdlite merged 2 commits intofacebook:mainfrom Aug 8, 2023
Merged
Bugfix: Fix crash when suspending in shell during useSES re-render#27199acdlite merged 2 commits intofacebook:mainfrom
acdlite merged 2 commits intofacebook:mainfrom
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.
acdlite
commented
Aug 7, 2023
|
|
||
| // Before B renders, mutate the store. | ||
| store.set('Updated'); | ||
| }); |
Collaborator
Author
There was a problem hiding this comment.
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) |
eps1lon
approved these changes
Aug 8, 2023
| ); | ||
| // We assume the tree is now consistent because we didn't yield to any | ||
| // concurrent events. | ||
| renderWasConcurrent = false; |
Collaborator
There was a problem hiding this comment.
This is just for clarity, right? As far as I can tell, it's not read anymore at this point.
Collaborator
Author
There was a problem hiding this comment.
yeah :D in case a continue gets added later in the loop or something
github-actions bot
pushed a commit
that referenced
this pull request
Aug 8, 2023
…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)
kodiakhq bot
pushed a commit
to vercel/next.js
that referenced
this pull request
Aug 12, 2023
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
EdisonVan
pushed a commit
to EdisonVan/react
that referenced
this pull request
Apr 15, 2024
…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.
bigfootjon
pushed a commit
that referenced
this pull request
Apr 18, 2024
…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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.