-
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
Fix flushing suspense fallbacks at the end of Act when the scheduler is mocked #19471
Conversation
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 a27a0d7:
|
0e37320
to
a27a0d7
Compare
// Flush callbacks at the end. | ||
return isFlushingAct; | ||
} | ||
|
||
// `IsThisRendererActing.current` is used by ReactTestUtils version of `act`. | ||
if (IsThisRendererActing.current) { |
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 core issue for the bug I'm fixing is that IsThisRendererActing.current
is not reset to false before we check shouldForceFlushFallbacksInDEV
, meaning that we miss the isFlushingAct = true
value, and we schedule the fallback here instead of committing it.
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.
@acdlite what was the expected behavior here? Should we be checking for isFlushingAct first?
Is the test that failed correct or is it actually wrong?
I think we need to start over on the act stuff. It's too convoluted. I'm loath to add another hacky workaround. To unblock the RN sync, can you mitigate by disabling the test or something? This doesn't seem important enough to block the whole sync. |
Yeah I can do that 👍 |
Overview
WIP - I think this treats the symptom and not the cause, but shows the issue, what works, and what tests break.