{"action":"closed","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/2842","repository_url":"https://api.github.com/repos/realm/realm-java","labels_url":"https://api.github.com/repos/realm/realm-java/issues/2842/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/2842/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/2842/events","html_url":"https://github.com/realm/realm-java/issues/2842","id":155745806,"number":2842,"title":"RealmResults not updating real time after deletion","user":{"login":"joey-harward","id":432554,"avatar_url":"https://avatars.githubusercontent.com/u/432554?v=3","gravatar_id":"","url":"https://api.github.com/users/joey-harward","html_url":"https://github.com/joey-harward","followers_url":"https://api.github.com/users/joey-harward/followers","following_url":"https://api.github.com/users/joey-harward/following{/other_user}","gists_url":"https://api.github.com/users/joey-harward/gists{/gist_id}","starred_url":"https://api.github.com/users/joey-harward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joey-harward/subscriptions","organizations_url":"https://api.github.com/users/joey-harward/orgs","repos_url":"https://api.github.com/users/joey-harward/repos","events_url":"https://api.github.com/users/joey-harward/events{/privacy}","received_events_url":"https://api.github.com/users/joey-harward/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-java/labels/S:Waiting%20For%20User","name":"S:Waiting For User","color":"ededed"},{"url":"https://api.github.com/repos/realm/realm-java/labels/T:Help","name":"T:Help","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-19T14:08:42Z","updated_at":"2016-05-19T14:58:43Z","closed_at":"2016-05-19T14:58:43Z","body":"After running the following code I would have expected the realmList AND realmResults to be the same size after deleting a Realm object contained by both.\r\n\r\n```java\r\nRealmList<Notification> realmList = getNotifications();\r\nif (realmList != null && !realmList.isEmpty())\r\n{\r\n\tRealmQuery<Notification> query = realmList.where()\r\n\t\t\t.notEqualTo(\"notificationType\", Notification.TYPE_BOARD_MESSAGE)\r\n\t\t\t.notEqualTo(\"notificationType\", Notification.TYPE_DIRECT_MESSAGE);\r\n\r\n\tRealmResults<Notification> realmResults = query.findAllSorted(Notification.PARAM_CREATED_AT, Sort.DESCENDING);\r\n\r\n\tLog.d(\"REALM_TEST\", \"realmList before has \" + realmList.size() + \" items\");\r\n\tLog.d(\"REALM_TEST\", \"realmResults before has \" + realmResults.size() + \" items\");\r\n\r\n\tNotification firstNotification = realmList.first();\r\n\trealm.beginTransaction();\r\n\tfirstNotification.deleteFromRealm();\r\n\trealm.commitTransaction();\r\n\r\n\tLog.d(\"REALM_TEST\", \"realmList after has \" + realmList.size() + \" items\");\r\n\tLog.d(\"REALM_TEST\", \"realmResults after has \" + realmResults.size() + \" items\");\r\n}\r\n```\r\n\r\n**Output**\r\nD/REALM_TEST: realmList before has 5 items\r\nD/REALM_TEST: realmResults before has 5 items\r\nD/REALM_TEST: realmList after has 4 items\r\nD/REALM_TEST: realmResults after has 5 items\r\n\r\nThe realmList updates correctly, removing the object real time.  The realmResults however changes the object to \"Invalid object\" but does not remove it from the list.  This results in unexpected behavior, especially when looping over the results.\r\n\r\nIs there a better way to achieve this?\r\n\r\nThanks in advance for any help on this.\r\n\r\n#### Version of Realm and tooling\r\nRealm version: 0.90.1\r\n\r\nAndroid Studio version: 2.1.1\r\n\r\nAndroid version: Android 6.0\r\n"}}