{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/3996","repository_url":"https://api.github.com/repos/realm/realm-cocoa","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3996/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3996/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3996/events","html_url":"https://github.com/realm/realm-cocoa/issues/3996","id":172761504,"number":3996,"title":"List<Object>.addNotificationBlock is behaving strangely","user":{"login":"anlaital","id":2168023,"avatar_url":"https://avatars.githubusercontent.com/u/2168023?v=3","gravatar_id":"","url":"https://api.github.com/users/anlaital","html_url":"https://github.com/anlaital","followers_url":"https://api.github.com/users/anlaital/followers","following_url":"https://api.github.com/users/anlaital/following{/other_user}","gists_url":"https://api.github.com/users/anlaital/gists{/gist_id}","starred_url":"https://api.github.com/users/anlaital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anlaital/subscriptions","organizations_url":"https://api.github.com/users/anlaital/orgs","repos_url":"https://api.github.com/users/anlaital/repos","events_url":"https://api.github.com/users/anlaital/events{/privacy}","received_events_url":"https://api.github.com/users/anlaital/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-23T17:41:43Z","updated_at":"2016-08-23T18:26:22Z","closed_at":null,"body":"## Goals\r\n\r\nObserve changes in a `List<Object>`.\r\n\r\n## Expected Results\r\n\r\n`.Initial` is received first in `addNotificationBlock` closure.\r\n\r\n## Actual Results\r\n\r\n`.Update` is received first, where both `deletions` and `insertions` have index `0`. \r\n\r\nSuppose an `Object` subclass that contains `let children = List<SomeObject>`.  Prior to this change notification, calling `object.valueForKeyPath(\"children\")` results correctly in `List<SomeObject>`. After this update notification is received, behavior is changed so that `RLMArray` is returned instead.\r\n\r\nThe documentation states the following: `Notifications can't be delivered as long as the run loop is blocked by other activity. When notifications can't be delivered instantly, multiple notifications may be coalesced into a single notification. This can include the notification with the initial list.`\r\n\r\nHowever, no insertions or deletions should've been made to the `List` in question.\r\n\r\n## Steps to Reproduce\r\n\r\nN/A\r\n\r\n## Code Sample\r\n\r\nN/A\r\n\r\n## Version of Realm and Tooling\r\n\r\nRealm version: 1.0.2\r\n\r\nXcode version: 7.3.1\r\n\r\niOS/OSX version: 9.x\r\n\r\nDependency manager + version: CocoaPods 1.0.1\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/241828085","html_url":"https://github.com/realm/realm-cocoa/issues/3996#issuecomment-241828085","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3996","id":241828085,"user":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T18:26:22Z","updated_at":"2016-08-23T18:26:22Z","body":"To be clear, there are two issues here?\r\n\r\nOne is that, under certain circumstances that you've yet to pin down, `List.addNotificationBlock` triggers an invalid `.Update` notification instead of an `.Initial` notification?\r\n\r\nThe other is that `object.valueForKeyPath(\"children\")` correctly returns a `List` if invoked before the first notification is received, then incorrectly returns an `RLMArray` afterwards?"}}
{"actor":{"display_login":"jpsim"}}