[Bugfix] Prevent already-committed setState callback from firing again during a rebase #21498
+59
−2
Conversation
Happens during a rebase (low priority update followed by high priority update). The high priority callback gets fired twice.
Before enqueueing the effect, adds a guard to check if the update was already committed.
|
Comparing: b770f75...a807e67 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) |
| expect(Scheduler).toHaveYielded([0]); | ||
|
|
||
| await ReactNoop.act(async () => { | ||
| app.setState({step: 1}, () => |
rickhanlonii
May 12, 2021
Member
Should this be wrapped in startTransition for the default sync case?
Should this be wrapped in startTransition for the default sync case?
acdlite
May 12, 2021
Author
Member
For this test it only matters that it's lower priority than discrete/sync (default sync !== discrete sync)
For this test it only matters that it's lower priority than discrete/sync (default sync !== discrete sync)
46491dc
into
facebook:master
34 checks passed
34 checks passed
ci/circleci: yarn_test--r=stable --env=development --persistent
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=development --variant=false
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=development --variant=true
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=production --variant=false
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=production --variant=true
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=development --variant=false
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=development --variant=true
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=production --variant=false
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=production --variant=true
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build---project=devtools -r=experimental
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build--r=experimental --env=development
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build--r=experimental --env=production
Your tests passed on CircleCI!
Details
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.


First commit adds a failing test.
Second commit fixes it.