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: avoid unmounting React components twice #16280

Merged
merged 2 commits into from
Apr 30, 2021

Conversation

elevatebart
Copy link
Contributor

User facing changelog

When clicking fast between specs we used to have a blocking error saying something about invariant,

After this PR the bug is gone.

Additional details

Unmounting was done twice and the second time was the culprit. If the two hooks are called quickly enough, the second one will try to change the invariant of the first and trigger this issue,

NOTE: I am 99% sure this is the only problem, but, since this cleanup was necessary anyway, this PR cannot hurt. If we notice the bug in the future, we can re-open the ticket.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 29, 2021

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Apr 30, 2021



Test summary

4032 0 49 2Flakiness 0


Run details

Project cypress
Status Passed
Commit cbdf9b8
Started Apr 30, 2021 2:05 AM
Ended Apr 30, 2021 2:15 AM
Duration 10:17 💡
OS Linux Debian - 10.8
Browser Chrome 89

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@lmiller1990
Copy link
Contributor

I tested it, working great - I could not get the invariant error.

lmiller1990
lmiller1990 previously approved these changes Apr 30, 2021
@elevatebart elevatebart changed the base branch from develop to master April 30, 2021 01:40
@elevatebart elevatebart dismissed stale reviews from ghost and lmiller1990 April 30, 2021 01:40

The base branch was changed.

@elevatebart elevatebart requested a review from a team as a code owner April 30, 2021 01:40
@elevatebart elevatebart requested review from jennifer-shehane and kuceb and removed request for a team April 30, 2021 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vite/React fast spec switching throws an invariant error
2 participants