{"action":"closed","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/4261","labels_url":"https://api.github.com/repos/meteor/meteor/issues/4261/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/4261/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/4261/events","html_url":"https://github.com/meteor/meteor/issues/4261","id":70403241,"number":4261,"title":"this.userId has wrong value in method","user":{"login":"steph643","id":7039479,"avatar_url":"https://avatars.githubusercontent.com/u/7039479?v=3","gravatar_id":"","url":"https://api.github.com/users/steph643","html_url":"https://github.com/steph643","followers_url":"https://api.github.com/users/steph643/followers","following_url":"https://api.github.com/users/steph643/following{/other_user}","gists_url":"https://api.github.com/users/steph643/gists{/gist_id}","starred_url":"https://api.github.com/users/steph643/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steph643/subscriptions","organizations_url":"https://api.github.com/users/steph643/orgs","repos_url":"https://api.github.com/users/steph643/repos","events_url":"https://api.github.com/users/steph643/events{/privacy}","received_events_url":"https://api.github.com/users/steph643/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/meteor/meteor/labels/Project:Accounts%20(in%20user%20apps)","name":"Project:Accounts (in user apps)","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-23T12:44:48Z","updated_at":"2015-04-28T22:59:34Z","closed_at":"2015-04-28T22:59:34Z","body":"Consider the following code:\r\n\r\n```javascript\r\n//---------------------------------\r\n\r\nif (Meteor.isServer)\r\n  Meteor.users.remove({});\r\n\r\n//---------------------------------\r\n\r\nMeteor.methods({\r\n\r\n  // Create a user account\r\n  createJohnAccount: function () {\r\n    Accounts.createUser({\r\n      username: 'john',\r\n      email   : 'john@g.com',\r\n      password: '123456'\r\n    });\r\n  },\r\n\r\n  // Delete the current user then call 'doSomething'\r\n  removeUser: function () {\r\n    console.log('BEGIN - deleteUser: about to remove user ' + this.userId);\r\n    Meteor.users.remove(this.userId);\r\n    console.log('END   - deleteUser: user has now been removed');\r\n    Meteor.call('doSomething');\r\n  },\r\n\r\n  // Do something based on userId\r\n  doSomething: function () {\r\n    console.log('this.userId = ' + this.userId + ' (shouldn\\'t it be null?!)');\r\n  }\r\n});\r\n\r\n//---------------------------------\r\n\r\n// On client...\r\nif (Meteor.isClient) {\r\n  Meteor.startup(function () {\r\n    // create a user...\r\n    Meteor.call('createJohnAccount', function (error, result) {\r\n      // then log him in...\r\n      Meteor.loginWithPassword('john', '123456', function (error) {\r\n        // then remove him...\r\n        Meteor.call('removeUser');\r\n      });\r\n    });\r\n  });\r\n}\r\n\r\n//---------------------------------\r\n```\r\nIt gives this output both on client and server:\r\n```\r\nI20150423-14:40:51.199(2)? BEGIN - deleteUser: about to remove user qkY5CaAJJ6Sx9nJgm\r\nI20150423-14:40:51.201(2)? END   - deleteUser: user has now been removed\r\nI20150423-14:40:51.202(2)? this.userId = qkY5CaAJJ6Sx9nJgm (shoudln't it be null?!)\r\n```\r\n\r\nIn a method, shouldn't `this.userId` be `null` after user removal?\r\n\r\n(please let me know if you need a repo)\r\n"}}