Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report errors from obtainPermanentObjectIDsForInsertedObjects #2135

Merged
merged 1 commit into from Jan 20, 2015

Conversation

sixten
Copy link
Contributor

@sixten sixten commented Jan 15, 2015

The implementation of -[RKManagedObjectRequestOperation obtainPermanentObjectIDsForInsertedObjects:] calls -[NSManagedObjectContext obtainPermanentIDsForObjects:error:], but does not pass an error pointer. This means that when the attempt to obtain IDs fails, and the method returns NO, it doesn't pass an error back up. That, in turn, means that the chain of completion blocks gets called with nil for both arguments, which is ultimately, and incorrectly, interpreted as success.

I have seen accounts of crashes when passing a non-NULL pointer to this method, which may be why this code is this way now. If that's the case, and the real Core Data error can't be obtained and returned, this method should at least generate a new synthetic RestKit error in its failure case, so that everything else behaves properly.

@segiddins
Copy link
Member

@blakewatters any reason not to merge this?

segiddins added a commit that referenced this pull request Jan 20, 2015
Report errors from obtainPermanentObjectIDsForInsertedObjects
@segiddins segiddins merged commit 47123ea into RestKit:master Jan 20, 2015
@segiddins
Copy link
Member

Thanks @sixten :)

@sixten sixten deleted the obtain-ids-error branch June 28, 2016 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants