{"action":"created","issue":{"url":"https://api.github.com/repos/Roobiq/RBQFetchedResultsController/issues/17","labels_url":"https://api.github.com/repos/Roobiq/RBQFetchedResultsController/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/Roobiq/RBQFetchedResultsController/issues/17/comments","events_url":"https://api.github.com/repos/Roobiq/RBQFetchedResultsController/issues/17/events","html_url":"https://github.com/Roobiq/RBQFetchedResultsController/issues/17","id":82262110,"number":17,"title":"Invalid Value for Primary Key","user":{"login":"nanoxd","id":1889575,"avatar_url":"https://avatars.githubusercontent.com/u/1889575?v=3","gravatar_id":"","url":"https://api.github.com/users/nanoxd","html_url":"https://github.com/nanoxd","followers_url":"https://api.github.com/users/nanoxd/followers","following_url":"https://api.github.com/users/nanoxd/following{/other_user}","gists_url":"https://api.github.com/users/nanoxd/gists{/gist_id}","starred_url":"https://api.github.com/users/nanoxd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanoxd/subscriptions","organizations_url":"https://api.github.com/users/nanoxd/orgs","repos_url":"https://api.github.com/users/nanoxd/repos","events_url":"https://api.github.com/users/nanoxd/events{/privacy}","received_events_url":"https://api.github.com/users/nanoxd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-05-29T04:54:17Z","updated_at":"2015-05-29T12:44:39Z","closed_at":null,"body":"I keep running into errors when attempting to call `updateFetchRequest`. It works fine when it is called once, but while switching through my data's different states via predicates, it gives me the following stack trace:\r\n\r\n```\r\n2015-05-28 21:27:45.534 app[92238:28255111] *** Terminating app due to uncaught exception 'RLMException', reason: 'Invalid value '96356644' for primary key'\r\n*** First throw call stack:\r\n(\r\n\t0   CoreFoundation                      0x000000010ee42c65 __exceptionPreprocess + 165\r\n\t1   libobjc.A.dylib                     0x0000000111929bb7 objc_exception_throw + 45\r\n\t2   Realm                               0x000000010e576385 RLMGetObject + 1093\r\n\t3   Realm                               0x000000010e5640d8 +[RLMObject objectInRealm:forPrimaryKey:] + 136\r\n\t4   RBQFetchedResultsController         0x000000010e5103c0 -[RBQFetchedResultsController createChangeSetsWithAddedSafeObjects:deletedSafeObjects:changedSafeObjects:state:] + 2352\r\n\t5   RBQFetchedResultsController         0x000000010e50c07d -[RBQFetchedResultsController calculateChangesWithAddedSafeObjects:deletedSafeObjects:changedSafeObjects:realm:] + 2173\r\n\t6   RBQFetchedResultsController         0x000000010e50aed8 __58-[RBQFetchedResultsController registerChangeNotifications]_block_invoke + 1208\r\n\t7   RBQFetchedResultsController         0x000000010e51d406 -[RBQRealmNotificationManager sendNotificationsWithRealm:entityChanges:] + 518\r\n\t8   RBQFetchedResultsController         0x000000010e51f660 __50-[RBQRealmChangeLogger registerChangeNotification]_block_invoke + 256\r\n\t9   Realm                               0x000000010e5bd58a -[RLMRealm sendNotifications:] + 986\r\n\t10  Realm                               0x000000010e5bd9c6 -[RLMRealm commitWriteTransaction] + 262\r\n\t11  app                          0x000000010e092a3c _TZFC105pp5Shift13fromJSONArrayfMS0_FPSs9AnyObject_GSaS0__ + 1964\r\n\t12  app                          0x000000010e05dc3b _TFFC10app17CalendarViewModel15invokeShiftListFS0_FTGSqGVSs10DictionarySSPSs9AnyObject___10completionFT_T__T_U_FTGSQCSo22AFHTTPRequestOperation_GSQPS2____T_ + 331\r\n\t13  app                          0x000000010df8fdb3 _TTRXFo_oGSQCSo22AFHTTPRequestOperation_oGSQPSs9AnyObject___dT__XFo_iTGSQS__GSQPS0_____iT__ + 35\r\n\t14  app                          0x000000010e05bbd1 _TPA__TTRXFo_oGSQCSo22AFHTTPRequestOperation_oGSQPSs9AnyObject___dT__XFo_iTGSQS__GSQPS0_____iT__ + 81\r\n\t15  app                          0x000000010e02a097 _TTRXFo_iTGSQCSo22AFHTTPRequestOperation_GSQPSs9AnyObject____iT__XFo_oGSQS__oGSQPS0____dT__ + 39\r\n\t16  app                          0x000000010e02a0e9 _TTRXFo_oGSQCSo22AFHTTPRequestOperation_oGSQPSs9AnyObject___dT__XFdCb_dGSQS__dGSQPS0____dT__ + 73\r\n\t17  SBJSONRPCClient                     0x000000010e858067 __67-[SBJSONRPCClient HTTPRequestOperationWithRequest:success:failure:]_block_invoke + 471\r\n\t18  AFNetworking                        0x000000010e3f6b48 __64-[AFHTTPRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke46 + 40\r\n\t19  libdispatch.dylib                   0x0000000111c80186 _dispatch_call_block_and_release + 12\r\n\t20  libdispatch.dylib                   0x0000000111c9f614 _dispatch_client_callout + 8\r\n\t21  libdispatch.dylib                   0x0000000111c87a1c _dispatch_main_queue_callback_4CF + 1664\r\n\t22  CoreFoundation                      0x000000010edaa1f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9\r\n\t23  CoreFoundation                      0x000000010ed6bdcb __CFRunLoopRun + 2043\r\n\t24  CoreFoundation                      0x000000010ed6b366 CFRunLoopRunSpecific + 470\r\n\t25  GraphicsServices                    0x0000000114333a3e GSEventRunModal + 161\r\n\t26  UIKit                               0x000000010ffaf900 UIApplicationMain + 1282\r\n\t27  app                          0x000000010e057d27 main + 135\r\n\t28  libdyld.dylib                       0x0000000111cd3145 start + 1\r\n)\r\n\r\n```\r\n\r\nI can successfully switch once to a different fetchRequest without crashing. Any more times crashes the app. It also doesn't happen on the same primary key, it's random. "},"comment":{"url":"https://api.github.com/repos/Roobiq/RBQFetchedResultsController/issues/comments/106793382","html_url":"https://github.com/Roobiq/RBQFetchedResultsController/issues/17#issuecomment-106793382","issue_url":"https://api.github.com/repos/Roobiq/RBQFetchedResultsController/issues/17","id":106793382,"user":{"login":"nanoxd","id":1889575,"avatar_url":"https://avatars.githubusercontent.com/u/1889575?v=3","gravatar_id":"","url":"https://api.github.com/users/nanoxd","html_url":"https://github.com/nanoxd","followers_url":"https://api.github.com/users/nanoxd/followers","following_url":"https://api.github.com/users/nanoxd/following{/other_user}","gists_url":"https://api.github.com/users/nanoxd/gists{/gist_id}","starred_url":"https://api.github.com/users/nanoxd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanoxd/subscriptions","organizations_url":"https://api.github.com/users/nanoxd/orgs","repos_url":"https://api.github.com/users/nanoxd/repos","events_url":"https://api.github.com/users/nanoxd/events{/privacy}","received_events_url":"https://api.github.com/users/nanoxd/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T12:44:39Z","updated_at":"2015-05-29T12:44:39Z","body":"No change, similar stack trace as before. Another interesting thing I've noticed is when this occurs, Realm says there are 1000 items in the table. "}}