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

User: Fix bug where fetch error prevents any further attempts #2730

Merged
merged 1 commit into from
Jan 28, 2016

Conversation

jordwest
Copy link
Contributor

The User object has a fetching property used to avoid doubling up on fetch requests. If user.fetching is true, any attempts to call user.fetch() will be ignored. This PR fixes a bug where this.fetching was not being reset after a failed fetch.

Before this change

  1. user.fetch() is called
  2. An error occurs during fetch
  3. user.fetch() is called again, but the attempt is ignored

After this change

  1. user.fetch() is called
  2. An error occurs during fetch
  3. user.fetch() is called again, the request is made as expected

@jordwest jordwest added [Type] Bug [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jan 25, 2016
@jordwest jordwest self-assigned this Jan 25, 2016
@dmsnell
Copy link
Member

dmsnell commented Jan 27, 2016

Looks good to me. I had a similar bug not too long ago with the importer. :shipit:

@dmsnell dmsnell added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jan 27, 2016
@jordwest jordwest force-pushed the fix/user-fetch-error-prevents-further-attempts branch from e376ef6 to b52320e Compare January 28, 2016 09:33
jordwest added a commit that referenced this pull request Jan 28, 2016
…s-further-attempts

User: Fix bug where fetch error prevents any further attempts
@jordwest jordwest merged commit 7719da4 into master Jan 28, 2016
@jordwest jordwest deleted the fix/user-fetch-error-prevents-further-attempts branch January 28, 2016 10:22
@scruffian
Copy link
Member

This change broke signup for logged out users, because we assume that user.get() is falsey unless the user is logged in. We should still try to address this issue, but we need to ensure that we don't break signup next time.

@jordwest
Copy link
Contributor Author

@drewblaisdell @scruffian Thanks for catching this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants