{"action":"created","issue":{"url":"https://api.github.com/repos/hyperoslo/Sync/issues/145","labels_url":"https://api.github.com/repos/hyperoslo/Sync/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/hyperoslo/Sync/issues/145/comments","events_url":"https://api.github.com/repos/hyperoslo/Sync/issues/145/events","html_url":"https://github.com/hyperoslo/Sync/issues/145","id":118259999,"number":145,"title":"Looks like Smart-updates not working","user":{"login":"f1nality","id":1628232,"avatar_url":"https://avatars.githubusercontent.com/u/1628232?v=3","gravatar_id":"","url":"https://api.github.com/users/f1nality","html_url":"https://github.com/f1nality","followers_url":"https://api.github.com/users/f1nality/followers","following_url":"https://api.github.com/users/f1nality/following{/other_user}","gists_url":"https://api.github.com/users/f1nality/gists{/gist_id}","starred_url":"https://api.github.com/users/f1nality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1nality/subscriptions","organizations_url":"https://api.github.com/users/f1nality/orgs","repos_url":"https://api.github.com/users/f1nality/repos","events_url":"https://api.github.com/users/f1nality/events{/privacy}","received_events_url":"https://api.github.com/users/f1nality/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-11-22T12:12:56Z","updated_at":"2015-11-24T10:25:04Z","closed_at":null,"body":"Hello,\r\nI'm using Sync to update my managedobjects.\r\nI retrieve 1000 objects from my api and use Sync.changes to update objects. Though there are absolutely no changes since last fetch 200+ objects are being refreshed (from NSManagedObjectContextObjectsDidChangeNotificationt). \r\n\r\nNSFetchedResultsControllers also update the whole collectionview as number of updates is rather big.\r\n\r\nAs a result I get collectionview.reloadData though no changes have been made.\r\n\r\nBy the way, logging is not working the same way as in README:\r\n```swift\r\n    func changeNotification(notification: NSNotification) {\r\n        NSLog(\"Updated: \\(notification.userInfo?[NSUpdatedObjectsKey])\") // =nil\r\n        NSLog(\"Deleted: \\(notification.userInfo?[NSDeletedObjectsKey])\") // =nil\r\n        NSLog(\"Inserted: \\(notification.userInfo?[NSInsertedObjectsKey])\") // =nil\r\n    }\r\n```\r\n```\r\nuserInfo\t__NSDictionaryM *\t2 key/value pairs\t0x00007fb2b09e8460\r\n[0]\t(null)\t\"refreshed\" : 280 objects\t\r\n[1]\t(null)\t\"managedObjectContext\" : (no summary)\t\r\n```\r\n\r\nI'm using swift and tvOS"},"comment":{"url":"https://api.github.com/repos/hyperoslo/Sync/issues/comments/159221821","html_url":"https://github.com/hyperoslo/Sync/issues/145#issuecomment-159221821","issue_url":"https://api.github.com/repos/hyperoslo/Sync/issues/145","id":159221821,"user":{"login":"f1nality","id":1628232,"avatar_url":"https://avatars.githubusercontent.com/u/1628232?v=3","gravatar_id":"","url":"https://api.github.com/users/f1nality","html_url":"https://github.com/f1nality","followers_url":"https://api.github.com/users/f1nality/followers","following_url":"https://api.github.com/users/f1nality/following{/other_user}","gists_url":"https://api.github.com/users/f1nality/gists{/gist_id}","starred_url":"https://api.github.com/users/f1nality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f1nality/subscriptions","organizations_url":"https://api.github.com/users/f1nality/orgs","repos_url":"https://api.github.com/users/f1nality/repos","events_url":"https://api.github.com/users/f1nality/events{/privacy}","received_events_url":"https://api.github.com/users/f1nality/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T10:25:04Z","updated_at":"2015-11-24T10:25:04Z","body":"> This definitely looks like a bug. I'll have a look when I get some time.\r\n\r\nI have found out that I was wrong about reason of this bug, it's not about predicate. This happened because I made simultaneous requests that fetched the same data. As a result sync added duplicates (but shouldn't?) and possible has broken something in db. After that this delete/insert operations happens after every request (even with predicate and without it). Only db clearing helps.\r\nWhat it interesting, duplicates disappear from collectionview after few more requests, but delete/insert operations happens after each request until I clear my db and stop making simultaneous requests with th same data.\r\n\r\n> You'll need to find a way to differentiate objects that belong to each page (this is why the predicate is needed). Otherwise Sync doesn't have a way to know what got deleted in each page.\r\n\r\nIt would be great if it can be customizable, don't you think? Not to delete objects which are not in `changes` I mean. Deleting happens in DATAFilter, am I right?"}}