{"action":"closed","issue":{"url":"https://api.github.com/repos/jashkenas/backbone/issues/3778","labels_url":"https://api.github.com/repos/jashkenas/backbone/issues/3778/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/backbone/issues/3778/comments","events_url":"https://api.github.com/repos/jashkenas/backbone/issues/3778/events","html_url":"https://github.com/jashkenas/backbone/issues/3778","id":103291868,"number":3778,"title":"Potential regression when setting `id` directly from 1.2.1 to 1.2.2","user":{"login":"swanson","id":56947,"avatar_url":"https://avatars.githubusercontent.com/u/56947?v=3","gravatar_id":"","url":"https://api.github.com/users/swanson","html_url":"https://github.com/swanson","followers_url":"https://api.github.com/users/swanson/followers","following_url":"https://api.github.com/users/swanson/following{/other_user}","gists_url":"https://api.github.com/users/swanson/gists{/gist_id}","starred_url":"https://api.github.com/users/swanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swanson/subscriptions","organizations_url":"https://api.github.com/users/swanson/orgs","repos_url":"https://api.github.com/users/swanson/repos","events_url":"https://api.github.com/users/swanson/events{/privacy}","received_events_url":"https://api.github.com/users/swanson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-26T15:06:41Z","updated_at":"2015-10-22T15:08:04Z","closed_at":"2015-10-22T15:08:04Z","body":"As part of upgrading from 1.2.1 to 1.2.2, we noticed an issue in our app where we were directly setting `id` on a model. I don't think this is the best way to set the id, but it is what it is.\r\n\r\n```js\r\nmodel.id = SOME_ID\r\n```\r\n\r\nAfter setting additional properties via `set` later in our code, `model.id` started to return `undefined`.\r\n\r\nBelow is a minimal example. The expected behavior is that both `console.log`'s will output \"123\". In 1.2.2 calling `set` is wiping out `model.id` (appears to be from this commit: https://github.com/jashkenas/backbone/commit/be7fc959641a3ccaa362110023ea7d697bc3f93b)\r\n\r\nYou can run these fiddles and see the output in the console.\r\n\r\n1.2.1: https://jsfiddle.net/jktms1xx/2/\r\n```sh\r\n> 123\r\n> 123\r\n```\r\n\r\n1.2.2: https://jsfiddle.net/g1am1otw/1/\r\n```sh\r\n> 123\r\n> undefined\r\n```\r\n\r\n---\r\n\r\nWe've resolved this issue by changing our code to call `model.set('id', SOME_ID)` - but we were wondering if setting `model.id` directly should continue to work. Thanks!\r\n\r\ncc @jbrad"}}