RestKit/RestKit — Issue #469: RKManagedObjectStore entity cache is out of sync when manually deleting objects in CoreData
Author: nomadplanet
Created: 2011-12-12 15:45:01+00:00
State: open

RKManagedObjectStore keeps a cache of CoreData entities, per thread.

When a managed object is manually deleted from CoreData ([object deleteEntity]), the cache is not updated, resulting in the store keeping one or more reference to the CoreData object now marked as fault.
Later, if RestKit happens to fetch through webservices the object that got deleted, the mapping will fail with a Core Data error (Validation error 1550 or 'NSObjectInaccessibleException - CoreData could not fulfill a fault error').
This is because RestKit is trying to map new values to the existing faulted entity, instead of creating a new one.

(More information in http://groups.google.com/group/restkit/browse_thread/thread/a05205448d7227df)