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 bug that introduced a race condition in consumers #2373

Merged
merged 2 commits into from
Nov 18, 2019

Conversation

amrocha
Copy link
Contributor

@amrocha amrocha commented Oct 28, 2019

WHY are these changes introduced?

Fixes #2333

WHAT is this pull request doing?

See #2089 (comment)

When I converted DatePicker to a functional component using hooks, I decided to simplify the code a bit as well. Since our tests and examples for the DatePicker are not thorough, this introduced a race condition that was hard to test locally. The only browser that triggered this condition consistently was Firefox, and only when also using the Month component.

This fixes that by waiting until state changes have resolved to trigger the callback

How to 🎩

yarn run build-consumer web and check out the analytics page on FF, as per the original issue

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2019

@amrocha
Copy link
Contributor Author

amrocha commented Oct 28, 2019

Hey @AndrewMusgrave , remember when we were talking about hookifying the DatePicker and we decided that we could simplify the code a bit and execute a callback sequentially instead of waiting for state changes to resolve? Remember when I said

I expect this to be basically equivalent

And then you said

I think we'll be ok

??

Well guess what 🙃🙃🙃🙃🙃🙃🙃🙃🙃🙃🙃🙃🙃

Copy link
Member

@AndrewMusgrave AndrewMusgrave left a comment

Choose a reason for hiding this comment

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

Thanks for following up on this 😄

@amrocha amrocha force-pushed the fix-datepicker-race-condition branch from c219d5c to 446f3e9 Compare November 18, 2019 15:20
@amrocha amrocha force-pushed the fix-datepicker-race-condition branch from 446f3e9 to 03c98b6 Compare November 18, 2019 15:42
@amrocha amrocha merged commit a0622b9 into master Nov 18, 2019
@amrocha amrocha deleted the fix-datepicker-race-condition branch November 18, 2019 16:02
amrocha pushed a commit that referenced this pull request Dec 5, 2019
amrocha added a commit that referenced this pull request Dec 5, 2019
#2520)

* Revert "Fix bug that introduced a race condition in consumers (#2373)"

This reverts commit a0622b9.

* revert changelog
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.

Datepicker jump in Firefox
2 participants