cbitstech / Purple-Robot

Sensing and automation platform for Android.
Other
38 stars 19 forks source link

PR: setUserId not setting the user ID #237

Closed estory1 closed 9 years ago

estory1 commented 10 years ago

Given PurpleRobot.setUserId() takes 1 parameter, a string for the new user ID (via: https://github.com/cbitstech/Purple-Robot/wiki/JavaScript-API#purplerobotlaunchapplicationapplicationnamestring-launchparamsobject-scriptstring)...

Repro:

1) Get existing user ID:

{
    "command": "execute_script",
    "script": "PurpleRobot.fetchUserId();"
}

2) Change it:

{
    "command": "execute_script",
    "script": "PurpleRobot.setUserId('foo@bar.com');"
}

3) Get original user ID by re-running step 1. Result for me on PR 1.5.15 (as of commit fc748518c12ff5ee68ac8047a69932c76c69b397) -- both during unit testing, and testing via the web UI -- is that the returned user ID is the string seen in step 1, rather than the "foo@bar.com" seen in step 2.

audaciouscode commented 9 years ago

Fixed.