{"action":"opened","issue":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1031","repository_url":"https://api.github.com/repos/ParsePlatform/parse-server","labels_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1031/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1031/comments","events_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1031/events","html_url":"https://github.com/ParsePlatform/parse-server/issues/1031","id":140904317,"number":1031,"title":"Attributes changed in beforeSave are not updated","user":{"login":"mmazzarolo","id":9536354,"avatar_url":"https://avatars.githubusercontent.com/u/9536354?v=3","gravatar_id":"","url":"https://api.github.com/users/mmazzarolo","html_url":"https://github.com/mmazzarolo","followers_url":"https://api.github.com/users/mmazzarolo/followers","following_url":"https://api.github.com/users/mmazzarolo/following{/other_user}","gists_url":"https://api.github.com/users/mmazzarolo/gists{/gist_id}","starred_url":"https://api.github.com/users/mmazzarolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmazzarolo/subscriptions","organizations_url":"https://api.github.com/users/mmazzarolo/orgs","repos_url":"https://api.github.com/users/mmazzarolo/repos","events_url":"https://api.github.com/users/mmazzarolo/events{/privacy}","received_events_url":"https://api.github.com/users/mmazzarolo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-15T08:19:47Z","updated_at":"2016-03-15T08:19:47Z","closed_at":null,"body":"Hello everyone,\r\nfirst of all thank you for releasing parse-server!\r\n\r\nNow on the issue:\r\n[Attributes changed on `beforeSave` are still not updated](https://github.com/ParsePlatform/parse-server/issues/866), even on Parse >= 2.1.5.\r\n\r\n#### Environment Setup\r\n```\r\n\"parse\": \"^1.7.1\",\r\n\"parse-server\": \"^2.1.6\",\r\n```\r\n\r\n#### Steps to reproduce\r\nJust create a test class called `TestClass`, put the following code in you parse-server main module and call the `test` endpoint:\r\n```javascript\r\nconst TestClass = Parse.Object.extend('TestClass')\r\n\r\nParse.Cloud.beforeSave('TestClass', (req, res) => {\r\n  const obj = req.object\r\n  console.log('[beforeSave] object: ', obj.toJSON())\r\n  obj.set('surname', 'this is not saved') // surname won't be saved on Parse\r\n  res.success(obj)\r\n})\r\n\r\nParse.Cloud.define('test', (req, res) => {\r\n  const test = new TestClass({ name: 'testtesttest' })\r\n  test.save()\r\n    .then(obj => {\r\n      console.log('After [beforeSave]: ', obj.toJSON())\r\n      res.success(obj)\r\n    })\r\n    .fail(err => res.error(err.message))\r\n})\r\n```\r\n\r\n#### Logs/Trace\r\nThe `surname` attribute is not saved/updated:\r\n```\r\n{\r\n  \"result\": {\r\n    \"name\": \"testtesttest\",\r\n    \"createdAt\": \"2016-03-15T07:56:25.711Z\",\r\n    \"updatedAt\": \"2016-03-15T07:56:25.711Z\",\r\n    \"objectId\": \"SSXFO5VfxU\",\r\n    \"__type\": \"Object\",\r\n    \"className\": \"TestClass\"\r\n  }\r\n}\r\n```"}}