Skip to content

Fix signUp and linkWith with an anonymous user #72

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
merged 1 commit into from
Aug 27, 2015
Merged

Conversation

grantland
Copy link
Contributor

Fixes integration test failures caused by #52

We strip anonymity in signUp and linkWith before calling into
saveAsync where there's a fork in logic for isLazy(). Since we now
determine isLazy() based off objectId != null && ParseAnonymousUtils.isLinked(this),
isLazy() returns the incorrect value for these logic paths.

The solution is to get the value of isLazy() before stripping anonymity
and passing it through to saveAsync().

  • Callers of resolveLazinessAsync never use it's return value, might as well make it Void
  • Make signUp more robust by reverting current user's password on failure if that's how it originally was
  • Make signUp more robust by reverting the current user's password on success

@grantland
Copy link
Contributor Author

Still writing a unit test that will simulate this behavior for the future.

/cc @lukas1994 @hallucinogen

@grantland
Copy link
Contributor Author

So it doesn't seem like there's a good way to write a unit test as the scenario is more of a integration test scenario, especially since I added saveAsync(sessionToken, isLazy, toAwait).

@lukas1994
Copy link
Contributor

LGTM
Do we have integration tests for this?

@hallucinogen
Copy link
Contributor

So this is basically the same as our initial behavior, except isLazy is being injected into saveAsync?

@grantland
Copy link
Contributor Author

@lukas1994 yeah we have integration tests for this. they're currently failing and this makes them pass

@hallucinogen pretty much

@hallucinogen
Copy link
Contributor

Sounds good then.

Fixes integration test failures caused by #52

We strip anonymity in `signUp` and `linkWith` before calling into
`saveAsync` where there's a fork in logic for `isLazy()`. Since we
now determine `isLazy()` based off `objectId != null && ParseAnonymousUtils.isLinked(this)`,
`isLazy()` returns the incorrect value for these logic paths.

The solution is to get the value of `isLazy()` before stripping
anonymity and passing it through to `saveAsync()`.

* Callers of resolveLazinessAsync never use it's return value, might as well make it Void
* Make signUp more robust by reverting current user's password on failure if that's how it originally was
* Make signUp more robust by reverting the current user's password on success
grantland added a commit that referenced this pull request Aug 27, 2015
Fix signUp and linkWith with an anonymous user
@grantland grantland merged commit 92ceb12 into master Aug 27, 2015
@grantland grantland deleted the grantland.lazy branch August 27, 2015 18:42
@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.

4 participants