Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Mapping operation errors result in treating all managed objects matching the URL as orphaned #1695

saniul opened this Issue · 1 comment

2 participants


When fetch requests are defined and we get a mapping operation error on a matching URL deleteLocalObjectsMissingFromMappingResult treats all managed objects matching the URL as orphaned.

As a result we lose all objects that match the request URL:

  • If we encounter an error that we could not map (RKUnprocessableError)
  • If the response body cannot be parsed
  • If we encounter an error and the response body is empty (RKUnprocessableError)

and, as far as we can see

  • If willMapDeserializedResponseBlock returns nil (RKMappingErrorMappingDeclined)
  • If no matching response descriptors were found (RKMappingErrorNotFound)

This is handled correctly only if the operation was canceled thanks to this line in RKManagedObjectRequestOperation.m

if ([weakSelf isCancelled]) return completionBlock(mappingResult, responseMappingError);

For the time being we are using this workaround

if (responseMappingError) return completionBlock(mappingResult, responseMappingError);

Hey @saniul, a failing unit test would really help us track down the problem. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.