{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/2650","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2650/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2650/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2650/events","html_url":"https://github.com/realm/realm-cocoa/pull/2650","id":110449533,"number":2650,"title":"[Query] Make sure that linked objects are attached","user":{"login":"mrackwitz","id":1389011,"avatar_url":"https://avatars.githubusercontent.com/u/1389011?v=3","gravatar_id":"","url":"https://api.github.com/users/mrackwitz","html_url":"https://github.com/mrackwitz","followers_url":"https://api.github.com/users/mrackwitz/followers","following_url":"https://api.github.com/users/mrackwitz/following{/other_user}","gists_url":"https://api.github.com/users/mrackwitz/gists{/gist_id}","starred_url":"https://api.github.com/users/mrackwitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrackwitz/subscriptions","organizations_url":"https://api.github.com/users/mrackwitz/orgs","repos_url":"https://api.github.com/users/mrackwitz/repos","events_url":"https://api.github.com/users/mrackwitz/events{/privacy}","received_events_url":"https://api.github.com/users/mrackwitz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/Review","name":"Review","color":"bfe5bf"},{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/wip","name":"wip","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-08T13:20:51Z","updated_at":"2015-10-10T09:45:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/2650","html_url":"https://github.com/realm/realm-cocoa/pull/2650","diff_url":"https://github.com/realm/realm-cocoa/pull/2650.diff","patch_url":"https://github.com/realm/realm-cocoa/pull/2650.patch"},"body":"Without that change, if you query for an object, which is linked to a just newly created object, which was never attached to the Realm, you get something arbitrary returned.\r\n\r\n* [ ] Changelog\r\n* [ ] Check whether object is in the *same* realm as the one being queried\r\n* [ ] Fix `RealmCollectionTypeTests.testArrayAggregateWithSwiftObjectDoesntThrow` Swift tests\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/147069813","html_url":"https://github.com/realm/realm-cocoa/pull/2650#issuecomment-147069813","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2650","id":147069813,"user":{"login":"mrackwitz","id":1389011,"avatar_url":"https://avatars.githubusercontent.com/u/1389011?v=3","gravatar_id":"","url":"https://api.github.com/users/mrackwitz","html_url":"https://github.com/mrackwitz","followers_url":"https://api.github.com/users/mrackwitz/followers","following_url":"https://api.github.com/users/mrackwitz/following{/other_user}","gists_url":"https://api.github.com/users/mrackwitz/gists{/gist_id}","starred_url":"https://api.github.com/users/mrackwitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrackwitz/subscriptions","organizations_url":"https://api.github.com/users/mrackwitz/orgs","repos_url":"https://api.github.com/users/mrackwitz/repos","events_url":"https://api.github.com/users/mrackwitz/events{/privacy}","received_events_url":"https://api.github.com/users/mrackwitz/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T09:45:34Z","updated_at":"2015-10-10T09:45:34Z","body":">`indexOfObject:` already does that.\r\n\r\nEven though it would be a breaking semantic change, I'd lean towards changing the behavior of `indexOfObject:` to fail irrecoverably in that case as well."}}