Skip to content
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

Closed

Conversation

rickhanlonii
Copy link
Member

@rickhanlonii rickhanlonii commented Jul 28, 2020

Overview

WIP - I think this treats the symptom and not the cause, but shows the issue, what works, and what tests break.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jul 28, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 28, 2020

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:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Jul 28, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against a27a0d7

@sizebot
Copy link

sizebot commented Jul 28, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against a27a0d7

// Flush callbacks at the end.
return isFlushingAct;
}

// `IsThisRendererActing.current` is used by ReactTestUtils version of `act`.
if (IsThisRendererActing.current) {
Copy link
Member Author

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.

Copy link
Member Author

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?

@acdlite
Copy link
Collaborator

acdlite commented Jul 28, 2020

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.

@rickhanlonii
Copy link
Member Author

Yeah I can do that 👍

@rickhanlonii rickhanlonii deleted the rh-fix-act-fallbacks branch July 28, 2020 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants