Skip to content

Fix interaction tracing for batched update mounts#15567

Merged
bvaughn merged 2 commits intofacebook:masterfrom
bvaughn:act-breaks-interaction-tracing
May 6, 2019
Merged

Fix interaction tracing for batched update mounts#15567
bvaughn merged 2 commits intofacebook:masterfrom
bvaughn:act-breaks-interaction-tracing

Conversation

@bvaughn
Copy link
Copy Markdown
Contributor

@bvaughn bvaughn commented May 4, 2019

When a root is mounting inside of a batched update (including the act test helper) the interactions Set in of ReactFiberScheduler is empty. This does not impact updates, only mounts.

The reason for this is that in that case, we never recorded the pending interactions on the root.

Technically the bug was related to batched updates, not act, but it seemed worth adding test coverage for both just in case there were changes in the future.

I came across this while trying to write profiling tests for the new DevTools (bvaughn/react-devtools-experimental#258). I've tested this change in that PR and verified that it fixes the disconnected interactions.

Resolves #15566

@bvaughn bvaughn changed the title [wip] Added failing test for act+interaction tracing Fix interaction tracing for batched update mounts May 5, 2019
@bvaughn bvaughn requested review from acdlite, gaearon and threepointone and removed request for acdlite and threepointone May 5, 2019 16:47
Copy link
Copy Markdown
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving because it makes sense to me, but deferring to @acdlite’s veto because he’s just so cool

Comment thread package.json
},
"devEngines": {
"node": "8.x || 9.x || 10.x || 11.x"
"node": "8.x || 9.x || 10.x || 11.x || 12.x"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't strictly necessary ^ but... 🤷‍♂

@bvaughn bvaughn merged commit 6da04b5 into facebook:master May 6, 2019
@bvaughn bvaughn deleted the act-breaks-interaction-tracing branch May 6, 2019 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Batched updates break interaction tracing for mounts

4 participants