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

current user update failed but session updated ! #450

Open
YousefAlsbaihi opened this issue Aug 2, 2019 · 2 comments
Open

current user update failed but session updated ! #450

YousefAlsbaihi opened this issue Aug 2, 2019 · 2 comments

Comments

@YousefAlsbaihi
Copy link

YousefAlsbaihi commented Aug 2, 2019

Issue Description

If the current user want to change his Email/username normally Parse check if username used by other user and if it is used it will return error, now this is good and work perfectly so far but the issue is the session is automatically updates to the new value where it failed.

so basically the session for the current user updated even if it wasn't for the backend

Steps to reproduce

$currentUser = Parse\ParseUser::getCurrentUser();
echo "Current Username is : ". $currentUser->get("username");

if ($currentUser) {
  $currentUser->set("username", "ww");
try {
        $currentUser->save();
        echo "UPDATED";
    } catch (Parse\ParseException $er) {
        $ex = $er->getMessage();
        echo "<br> Error: ". $ex;
    }
}

here is a video that explains more:

https://youtu.be/KWS9fW5MReA

@dplewis
Copy link
Member

dplewis commented Aug 5, 2019

Sorry for the delay? What version of Parse-Server are you using?

Is the session really updated or is the username updated locally? In the video you didn't output the session.

Can you write a failing test and describe what is expected to happen vs what actually happened?

@YousefAlsbaihi
Copy link
Author

it update everything in the user session but it doesn't in the backend
i'm using latest version using Back4App.com
however i found a solution to use $currentUser->fetch();

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

No branches or pull requests

2 participants