-
Notifications
You must be signed in to change notification settings - Fork 50.2k
[SuspenseList] Fix bugs with dropped Promises #17082
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
Conversation
For non-hidden modes, this boundary should commit so this shouldn't be needed but the nested boundary can make a second pass which forces these to be recreated without resuspending. In this case, the outer list assumes that it can collect the inner promises to still rerender if needed.
This means that we always rerender any nested SuspenseLists together. This bug looks similar to the previous one but is not based on the lack of retry but that the retry only happens on the outer boundary but the inner doesn't get a retry ping since it didn't know about its own promise after the second pass.
Details of bundled changes.Comparing: 75955bf...654572d react-art
react-dom
react-native-renderer
react-test-renderer
react-reconciler
|
acdlite
left a comment
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.
Re: the first fix, maybe we could try the thing where instead of attaching the promise to the inner Suspense boundary, it always gets attached to the outer SuspenseList, so that there's nothing to transfer if the inner boundary does another pass. Would that have worked in this case?
|
It’s tricky to do that in throwException because you have to know the context at every level and you don’t know the context of the shadowed levels. Otherwise you don’t know whether to continue bubbling or not. |
This includes two similar looking bug fixes to SuspenseList.
We must transfer any pending promises from inner boundary to list. For non-hidden modes, this boundary should commit so this shouldn't be needed but the nested boundary can make a second pass which forces these to be recreated without resuspending. In this case, the outer list assumes
that it can collect the inner promises to still rerender if needed.
Otherwise, the Promise never retries anything.
We must also propagate suspense "context" change to nested SuspenseLists. This bug looks similar to the previous one but is not based on the lack of retry but that the retry only happens on the outer boundary but the inner doesn't get a retry ping since it didn't know about its own promise after the second pass. So it bails out.