use-subscription tearing fix #16623
Merged
use-subscription tearing fix #16623
Conversation
jest.runAllTimers(); | ||
|
||
// Partial update "C" -> "D" | ||
// Interrupt with a second mutation "D" -> "E" but this should not cause tearing. |
bvaughn
Aug 30, 2019
Author
Contributor
This second interrupting mutation is required to trigger the previous failure. (Described in more detail in this issue comment.) I don't yet understand why this is but will be digging in more.
This second interrupting mutation is required to trigger the previous failure. (Described in more detail in this issue comment.) I don't yet understand why this is but will be digging in more.
bvaughn
Aug 30, 2019
Author
Contributor
It looks like React eagerly computes the state initially, for the first update. It doesn't do this or subsequent updates though because expirationTime !== NoWork
.
I'm not sure if this is expected, given that my test flushes all pending work.
It looks like React eagerly computes the state initially, for the first update. It doesn't do this or subsequent updates though because expirationTime !== NoWork
.
I'm not sure if this is expected, given that my test flushes all pending work.
bvaughn
Aug 30, 2019
Author
Contributor
@acdlite and I chatted about this offline and I have a better understanding of it now. I've updated the inline test comments. Going to hand this PR to him since he has full context now too.
@acdlite and I chatted about this offline and I have a better understanding of it now. I've updated the inline test comments. Going to hand this PR to him since he has full context now too.
Details of bundled changes.Comparing: f962feb...5ba5309 use-subscription
|
Ping @acdlite :) |
This was referenced Oct 5, 2019
This was referenced Apr 14, 2020
This was referenced Apr 21, 2020
This was referenced Apr 30, 2020
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.
Adds a test (previously failing) and a fix for a potential tearing case reported in #16396.
Resolves #16396