{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/5791","repository_url":"https://api.github.com/repos/realm/realm-cocoa","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/5791/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/5791/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/5791/events","html_url":"https://github.com/realm/realm-cocoa/issues/5791","id":327808913,"node_id":"MDU6SXNzdWUzMjc4MDg5MTM=","number":5791,"title":"Distinct(by:) returns wrong values","user":{"login":"1int","id":1285300,"node_id":"MDQ6VXNlcjEyODUzMDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1285300?v=4","gravatar_id":"","url":"https://api.github.com/users/1int","html_url":"https://github.com/1int","followers_url":"https://api.github.com/users/1int/followers","following_url":"https://api.github.com/users/1int/following{/other_user}","gists_url":"https://api.github.com/users/1int/gists{/gist_id}","starred_url":"https://api.github.com/users/1int/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1int/subscriptions","organizations_url":"https://api.github.com/users/1int/orgs","repos_url":"https://api.github.com/users/1int/repos","events_url":"https://api.github.com/users/1int/events{/privacy}","received_events_url":"https://api.github.com/users/1int/received_events","type":"User","site_admin":false},"labels":[{"id":320259723,"node_id":"MDU6TGFiZWwzMjAyNTk3MjM=","url":"https://api.github.com/repos/realm/realm-cocoa/labels/Help%20Wanted","name":"Help Wanted","color":"bfe5bf","default":false},{"id":3303142,"node_id":"MDU6TGFiZWwzMzAzMTQy","url":"https://api.github.com/repos/realm/realm-cocoa/labels/T:Bug","name":"T:Bug","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-30T16:35:27Z","updated_at":"2018-06-01T10:56:16Z","closed_at":null,"author_association":"NONE","body":"Here's my data:\r\n<img width=\"952\" alt=\"screen shot 2018-05-30 at 19 27 07\" src=\"https://user-images.githubusercontent.com/1285300/40733919-8d68babc-643f-11e8-8afe-ae26e2e50e44.png\">\r\n\r\nThere are 5 object, which have 3 different 'Estimates'.\r\n\r\nHere's my query:\r\n<code> self.inviati = self.realm.objects(QuoteRequest.self).filter(\"user.id=%s\", Auth.userId!).sorted(byKeyPath: \"timestamp\", ascending: false).distinct(by: [\"estimate.id\"])</code>\r\n\r\nI get 3 models returned, all of them have the same estimate.id\r\n\r\n<img width=\"302\" alt=\"screen shot 2018-05-30 at 19 33 57\" src=\"https://user-images.githubusercontent.com/1285300/40734223-77386566-6440-11e8-80e6-8aaed65ae8f9.png\">\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/393846422","html_url":"https://github.com/realm/realm-cocoa/issues/5791#issuecomment-393846422","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/5791","id":393846422,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Mzg0NjQyMg==","user":{"login":"bmunkholm","id":1215687,"node_id":"MDQ6VXNlcjEyMTU2ODc=","avatar_url":"https://avatars2.githubusercontent.com/u/1215687?v=4","gravatar_id":"","url":"https://api.github.com/users/bmunkholm","html_url":"https://github.com/bmunkholm","followers_url":"https://api.github.com/users/bmunkholm/followers","following_url":"https://api.github.com/users/bmunkholm/following{/other_user}","gists_url":"https://api.github.com/users/bmunkholm/gists{/gist_id}","starred_url":"https://api.github.com/users/bmunkholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmunkholm/subscriptions","organizations_url":"https://api.github.com/users/bmunkholm/orgs","repos_url":"https://api.github.com/users/bmunkholm/repos","events_url":"https://api.github.com/users/bmunkholm/events{/privacy}","received_events_url":"https://api.github.com/users/bmunkholm/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T10:56:16Z","updated_at":"2018-06-01T10:56:16Z","author_association":"CONTRIBUTOR","body":"Thanks for reporting @1int - we will check it.\r\n---\r\nEasy started task for anyone wanting to help. Start with creating a testcase that reproduce this."}}
{"actor":{"display_login":"bmunkholm"}}