Skip to content

Conversation

jorgea-stripe
Copy link

While callers of restyleAdopter check if their adopters are connected, restyleAdopter contains a call to requestAnimationFrame which means that adopters can be disconnected while the browser is waiting for the next repaint.

Here's the error that is thrown under those circumstances:
image.

This error bubbles up as an unhandled exception in certain apps (like in this NextJS setup):
image, as well as in the console.

The fix is to take into account that nodes may become disconnected in the callback of requestAnimationFrame. With this update, I can no longer repro this race condition.

@jorgea-stripe
Copy link
Author

@calebdwilliams would appreciate any feedback or a review for this fix!

@calebdwilliams
Copy link
Owner

@jorgea-stripe looks like the tests failed.

@jorgea-stripe
Copy link
Author

jorgea-stripe commented Jun 23, 2022

@calebdwilliams - I believe my latest change should fix the test that broke due to an outdated browser message! (I've run it locally however I don't have permission to run on the CI)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants