{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/4773","repository_url":"https://api.github.com/repos/emberjs/data","labels_url":"https://api.github.com/repos/emberjs/data/issues/4773/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/4773/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/4773/events","html_url":"https://github.com/emberjs/data/issues/4773","id":203456796,"number":4773,"title":"Unloaded records reappearing in hasMany relationships after query.","user":{"login":"sgargan","id":129249,"avatar_url":"https://avatars.githubusercontent.com/u/129249?v=3","gravatar_id":"","url":"https://api.github.com/users/sgargan","html_url":"https://github.com/sgargan","followers_url":"https://api.github.com/users/sgargan/followers","following_url":"https://api.github.com/users/sgargan/following{/other_user}","gists_url":"https://api.github.com/users/sgargan/gists{/gist_id}","starred_url":"https://api.github.com/users/sgargan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgargan/subscriptions","organizations_url":"https://api.github.com/users/sgargan/orgs","repos_url":"https://api.github.com/users/sgargan/repos","events_url":"https://api.github.com/users/sgargan/events{/privacy}","received_events_url":"https://api.github.com/users/sgargan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-26T18:54:20Z","updated_at":"2017-02-03T21:52:07Z","closed_at":"2017-02-03T21:52:07Z","body":"Since the 2.11 release we've been seeing duplication of entries in hasMany relationships when records are unloaded via the store and reloaded via a query. We use this unload/requery pattern in a number of places in our app to avoid displaying data that may have been deleted by another concurrent session.  \r\n\r\nSince 2.11 when records are returned in query results after being unloaded, their ids are duplicated in any in hasMany relationship that contained them.\r\n\r\nI've put together a [twiddle](https://ember-twiddle.com/0e329424ec7880edbf3923cc4c5c38bd?openFiles=routes.application.js%2C) that illustrates this. \r\n\r\nThis may be related to how we return the relationship information as we only return the inverse of the relationship i.e. in the example each folder contains it's parents id. When the child ids are specified explicitly the duplication does not occur.\r\n\r\nThis may well be related to https://github.com/emberjs/data/issues/4770."},"comment":{"url":"https://api.github.com/repos/emberjs/data/issues/comments/277372222","html_url":"https://github.com/emberjs/data/issues/4773#issuecomment-277372222","issue_url":"https://api.github.com/repos/emberjs/data/issues/4773","id":277372222,"user":{"login":"bmac","id":54056,"avatar_url":"https://avatars.githubusercontent.com/u/54056?v=3","gravatar_id":"","url":"https://api.github.com/users/bmac","html_url":"https://github.com/bmac","followers_url":"https://api.github.com/users/bmac/followers","following_url":"https://api.github.com/users/bmac/following{/other_user}","gists_url":"https://api.github.com/users/bmac/gists{/gist_id}","starred_url":"https://api.github.com/users/bmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmac/subscriptions","organizations_url":"https://api.github.com/users/bmac/orgs","repos_url":"https://api.github.com/users/bmac/repos","events_url":"https://api.github.com/users/bmac/events{/privacy}","received_events_url":"https://api.github.com/users/bmac/received_events","type":"User","site_admin":false},"created_at":"2017-02-03T21:52:07Z","updated_at":"2017-02-03T21:52:07Z","body":"This is fixed by https://github.com/emberjs/data/pull/4791 and the fix was published in the Ember Data 2.11.1 release. I'm going to close this issue now but please let me know if you are still experiencing a problem."}}
{"actor":{"display_login":"bmac"}}