Skip to content
This repository was archived by the owner on Jan 26, 2021. It is now read-only.
This repository was archived by the owner on Jan 26, 2021. It is now read-only.

ParseReact breaks Parse.User.logOut() #161

@lrettig

Description

@lrettig

ParseReact (0.5.0) patches Parse.User.logOut() (Parse 1.6.14) like so:

logOut: function() {
  var promise = oldLogOut();
  LocalSubscriptions.currentUser.update();
  return promise;
},

Unfortunately, this breaks logging out since LocalSubscriptions.currentUser.update() runs before oldLogOut() has finished and its promise has resolved. It calls Parse.User.currentAsync() -- which returns the still logged-in user -- and then on line 97 it calls setCurrentUser(current) which undoes the log out and logs the user right back in.

This it's impossible to log out the Parse user using Parse.User.logOut() with ParseReact installed. Help!

Important note: this bug only appears to manifest when A+ compliance is enabled on Parse Promises by calling Parse.Promise.enableAPlusCompliant()--apparently because of this difference:

All then callbacks are executed asynchronously.

(cf. http://stackoverflow.com/a/31223217/2397068)

However, enabling A+ compliance should not break this, and besides the Parse team intends to migrate all promises to A+ compliance (cf. parse-community/Parse-SDK-JS#57) so I think this does need to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions