Commit Graph

1584 Commits

Author SHA1 Message Date
Blake Watters
4759a90cdc Add more cancellation backstopping to avoid NSObjectInaccessibleException crashes when executing RKManagedObjectRequestOperation instances that have been cancelled and the Core Data environment has shifted underneath them (i.e. records have been deleted from the store) 2013-02-05 14:07:46 -05:00
Jeff Arena
91ede3b9b6 Add a few isCancelled checks to ensure we are not performing unnecessary work after being cancelled. 2013-02-05 12:06:33 -05:00
Blake Watters
00412cfebb Add rescue for NSObjectInaccessibleException within RKRelationshipConnectionOperation 2013-02-04 12:39:59 -05:00
Blake Watters
558c9bee83 Adjust implementation of async dispatching when managing cache entries so that there is only a single dispatch instead of N 2013-02-04 12:38:42 -05:00
Blake Watters
79150ad51e Guard against a potential "Could not fulfill a fault" crash during relationship connection if the object being connected has been deleted before the operation executes 2013-02-04 11:08:55 -05:00
Blake Watters
7c9264025f Add type for managedObjectStore in the factory 2013-02-04 10:44:04 -05:00
Blake Watters
ae8e3b17ca Relax assertion in RKSearchIndexer so that it does not fail in the event a nil managed object is returned by existingObjectWithID:error: 2013-02-02 09:25:02 -05:00
Blake Watters
45e3366b7c Reorder RKTestFactory dispatching of the tear down block so that you have reference to the current environment to perform the tearDown 2013-02-01 19:00:56 -05:00
Blake Watters
8958bc8415 Improve cancellation behaviors for in-progress RKManagedObjectRequestOperation instances 2013-02-01 19:00:04 -05:00
Blake Watters
0bbb603b9e Switch to using an NSRecursiveLock instead of @synchronized within RKEntityByAttributeCache. Avoid a potential deadlock when handling a NSManagedObjectContextObjectsDidChangeNotification notification 2013-02-01 18:59:26 -05:00
Blake Watters
197a54bf60 Rework metadata mapping to fix breakage under OS X 2013-02-01 11:26:08 -05:00
Blake Watters
f9c3e3a4d4 Add a lock around the overrideen error accessor on RKHTTPRequestOperation. refs #1193 2013-02-01 08:59:42 -05:00
Blake Watters
32c52f2d06 Enable metadata mapping for identification attributes. fixes #1202 2013-01-31 11:47:41 -05:00
Blake Watters
ec180fae5b Add a warning if you violate the save expectations of NSManagedObjectContext. fixes #1185 2013-01-29 11:51:41 -05:00
Blake Watters
4f442b142f Fix issue where NSManagedObject instances that are invalid due to missing require relationship when finished mapping, but are made valid by connected relationships are deleted prematurely. fixes #1179 2013-01-29 11:44:15 -05:00
Blake Watters
25e15508f6 Add missing interpolation value for assertion within search indexing 2013-01-29 10:55:39 -05:00
Blake Watters
5d7669bcc1 Fix creation of duplicated managed objects when you map a nil source key path onto an indentification attribute. fixes #1194 2013-01-29 10:03:19 -05:00
Blake Watters
2e5668012c Fix implicit conversion warning in RKDotNetDateFormatter. closes #1198 2013-01-29 09:31:22 -05:00
Jeff Arena
2f78250891 Change log level for a specific mapping operation failure case 2013-01-28 17:49:34 -05:00
Blake Watters
4840b4b63e Fix crash when attempting to union a relationship with a nil value. fixes #1195 2013-01-28 17:22:33 -05:00
Blake Watters
039c7c443d Fix issue where repeatedly mapping a to-many relationship without identification attributes would cause the first object in the relationship to be inappropriately reused 2013-01-26 12:10:55 -05:00
Blake Watters
d761de0ea7 Fix crash when attempting to map nil sourceKeyPath as identification attribute 2013-01-26 00:21:44 -05:00
Blake Watters
3e351509b3 Fix crash when accessing a named route with no object for interpolation 2013-01-25 17:27:38 -05:00
Blake Watters
0364d6c67b Integrate support for metadata mapping routing data. refs #1174 2013-01-24 23:16:48 -05:00
Blake Watters
4c39918fdb Implement support for flexible metdata mapping. closes #582, #688
* Metadata mapping is implemented via an `NSProxy` object that stands in for the `sourceObject` of each `RKMappingOperation`
* Key paths that are prefixed with `@metadata.` are mapped against the `metadata` dictionary of the operation, else they hit the `sourceObject`.
* Metadata is implemented by merging a dictionary of data in from `RKObjectRequestOperation`, through to `RKResponseMapperOperation`, into `RKMapperOperation`, and all the way down into the `RKMappingOperation`, where it is available to each object. By convention, metdata is namespaced into subdictionaries.
2013-01-24 16:31:19 -05:00
James Moschou
7ba7070d89 Fix RKObjectIsCollectionContainingOnlyManagedObjects function 2013-01-24 16:57:46 +10:30
Blake Watters
7cca6891ce Unwind earlier fix for obtaining permanent objectID for targetObject in favor of the overridden setter on RKManagedObjectRequestOperation 2013-01-23 17:28:08 -05:00
Blake Watters
2b84f667c1 Add support for obtaining a permanent managed object ID for the targetObject of an RKManagedObjectRequestOperation 2013-01-23 16:12:14 -05:00
Blake Watters
cd877860fd Tweak docs, add test cases for mapping a response with a descriptor that does not specify any attributes/relationships 2013-01-23 15:26:52 -05:00
Blake Watters
23ca0c7ca4 Fix potential crash due to serious Core Data error from failing to obtain a permanent objectID for an object that was just saved to the persistent store, but whose objectID is stale. fixes #1183 2013-01-23 13:20:55 -05:00
Blake Watters
120584e320 Add missing copy support for the entity and deletion predicate. closes #1184 2013-01-23 12:54:41 -05:00
Blake Watters
7ee9a9a866 Add missing EOF in ObjectMapping.h 2013-01-22 09:52:43 -05:00
Blake Watters
1885ee9e89 Add warning about deadlocks if you use waitUntilFinished with a RKManagedObjectRequestOperation on a main queue thread. refs #1173 2013-01-21 16:17:10 -05:00
Blake Watters
966e006990 Fix bug with refetching due to failure to track applied attribute mapping when mapped value is unchanged. closes #1176 2013-01-21 15:03:53 -05:00
Blake Watters
2351fc2472 Add unit test and fix for crash during eviction of cache keys during query for compound identification attributes. closes #1171 2013-01-21 13:18:42 -05:00
Blake Watters
abd207420b Fix missing language in log message 2013-01-21 12:55:39 -05:00
Blake Watters
2cf73d2436 Fix failed assertion when constructing an unprocessable response error for 5xx errors. closes #1169 2013-01-18 18:57:34 -05:00
Blake Watters
a75edcea2e Nil out targetObjectID if given a targetObject that is not an NSManagedObject. closes #1161 2013-01-18 17:28:49 -05:00
Blake Watters
3d971dc666 Encapsulate managed object refetching into an NSProxy object to enable you to defer the refetching until the mapping result is accessed (or skip it entirely if the result is not accessed) 2013-01-18 16:42:11 -05:00
Blake Watters
3d4c7b502d Copy attributeCaches to avoid potential for mutation during enumeration 2013-01-18 14:50:11 -05:00
Blake Watters
fc07e1fef7 Remove unnecessary exception handling for NSUndefinedKeyException 2013-01-18 14:48:22 -05:00
Blake Watters
06f2fe9c7b Radically simplify the implementation of managed object deletion and refetching within RKManagedObjectRequestOperation. closes #1163
1. Eliminates use of visitor in favor of aggregating mapping info during mapping. This avoids having to traverse the mapping graph.
1. Eliminate special case handling of cyclic key paths.
1. Eliminate issues with infinite recursion while traversing the mapping graph.
2013-01-18 12:20:51 -05:00
Blake Watters
ff7f538749 Add temporary workaround for infinite recursion 2013-01-17 23:31:28 -05:00
Blake Watters
f2abd1e107 Add test coverage verifying fix for crash during cyclic graph traversal in RKManagedObjectRequestOperation. closes #1142 2013-01-17 18:47:02 -05:00
Blake Watters
7bf14d4ea9 Rework implementation of cyclic mapping graph traversal. refs #1142 #1158 #1163 2013-01-17 15:08:30 -05:00
Blake Watters
a65a50e8f7 Fix bug with mapping nested attribute values with identification attributes when the identification attribute is not the nesting key. fixes #1129 2013-01-17 11:34:40 -05:00
Blake Watters
a2ca2ec937 Fix crash when serializing NSDate properties mapped at nested keypaths. fixes #1134 2013-01-17 11:01:24 -05:00
Blake Watters
01c34fe289 Fix crash when mapping to NSManagedObject class with Transformable attribute without a backing property. fixes #1162 2013-01-17 10:38:53 -05:00
James Moschou
02952aa2bb Add support for transforming strings 'Y' and 'N' to boolean NSNumber objects 2013-01-16 19:26:04 -05:00
Blake Watters
bcbbd65fbe Fix issue in which managed objects that are the children of non-managed objects were refetched and assigned as a collection rather than as a singular value. fixes #1118 2013-01-16 17:49:32 -05:00