Skip to content

Remove isLazy property in ParseUser #52

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 25, 2015

Conversation

lukas1994
Copy link
Contributor

We always have the invariant:
lazy == true <==> objectId == null && authData.get("anonymous") != null

So we can remove the additional property.

For testing: to get the "lazy" user behavior we need to make sure that the user has no objectId and we need to set "anonymous" authData (see setLazy() in ParseACLTest.java).

// This will set the unresolvedUser in acl
acl.setReadAccess(unresolvedUser, true);
acl.setWriteAccess(unresolvedUser, true);

unresolvedUser.setObjectId("test");
acl.resolveUser(unresolvedUser);
unresolvedUser.setObjectId("test");
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reasoning we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I'll remove this.

@grantland
Copy link
Contributor

@lukas1994 just a few questions

@grantland
Copy link
Contributor

LGTM

If you could squash and rebase on master, I can merge!

We always have the invariant:
lazy == true <==> objectId == null && authData.get("anonymous") != null

So we can remove the additional property.

For testing: to get the "lazy" user behavior we need to make sure that the user has no objectId and we need to set "anonymous" authData (see setLazy() in ParseACLTest.java).
@lukas1994 lukas1994 assigned grantland and unassigned lukas1994 Aug 25, 2015
grantland added a commit that referenced this pull request Aug 25, 2015
Remove isLazy property in ParseUser
@grantland grantland merged commit 44d3133 into parse-community:master Aug 25, 2015
@lukas1994 lukas1994 deleted the lazy branch August 25, 2015 20:42
grantland added a commit that referenced this pull request Aug 27, 2015
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()`.
grantland added a commit that referenced this pull request Aug 27, 2015
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()`.
grantland added a commit that referenced this pull request Aug 27, 2015
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
@facebook-github-bot
Copy link

@lukas1994 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.

3 participants