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: Multiple "current" ParseInstallation instances being created #208

Merged
merged 1 commit into from
Oct 26, 2015

Conversation

grantland
Copy link
Contributor

This fixes a race condition where multiple ParseInstallation instances
can be returned as "current".

Fixes #203

@facebook-github-bot
Copy link

By analyzing the blame information on this pull request, we identified @grantland to be a potential reviewer.

@wangmengyan95
Copy link
Contributor

Good catch. But why this race condition will make devieType to be null?

@grantland
Copy link
Contributor Author

@wangmengyan95 Described in depth here: #203 (comment)

Short version is that there could be multiple ParseInstallation instances returned from ParseInstallation.getCurrentInstallation(), but only one is really "current". Only the actual "current" will have the default values such as deviceType populated, while the other will not. This means that the context referencing the non-current ParseInstallation will receive the deviceType error when trying to save it.

@wangmengyan95
Copy link
Contributor

LGTM! Thanks for explanation.

This fixes a race condition where multiple `ParseInstallation`
instances can be returned as "current".
@grantland grantland force-pushed the grantland.fix-installation branch from e756eab to fbdffa7 Compare October 26, 2015 18:38
grantland added a commit that referenced this pull request Oct 26, 2015
Fix: Multiple "current" ParseInstallation instances being created
@grantland grantland merged commit eeb4203 into master Oct 26, 2015
@grantland grantland deleted the grantland.fix-installation branch October 26, 2015 18:38
@grantland grantland added this to the 1.11.0 milestone Nov 11, 2015
@facebook-github-bot
Copy link

@grantland updated the pull request.

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.

135 deviceType must be specified in this operation
3 participants