Skip to content

fix a race-condition with tokensByFile #48

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

Merged

Conversation

joeybaker
Copy link
Contributor

Because we’re setting tokensByFile before and after an async action,
and many of these actions can happen at the same time, there’s a race
condition where the incorrect tokensByFile can be set.

This accomplishes the same desire for caching by just keeping the loader
for every file since the loader already caches tokensByFile, and
prevents the race condition.

Because we’re setting `tokensByFile` before and after an async action,
and many of these actions can happen at the same time, there’s a race
condition where the incorrect `tokensByFile` can be set.

This accomplishes the same desire for caching by just keeping the loader
for every file since the loader already caches `tokensByFile`, and
prevents the race condition.
@joeybaker
Copy link
Contributor Author

@joshwnj would it be possible for you to take a look at this?

@joshwnj
Copy link
Member

joshwnj commented Oct 2, 2015

Sorry about the wait - just took a look and tried out with a few things. Looks good, thanks! 👍

joshwnj added a commit that referenced this pull request Oct 2, 2015
@joshwnj joshwnj merged commit bd3f253 into css-modules:master Oct 2, 2015
@joshwnj
Copy link
Member

joshwnj commented Oct 2, 2015

Published 0.9.0

@joeybaker
Copy link
Contributor Author

Thanks!

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.

2 participants