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
Use explicit userInfo
keys for NSManagedObjectContextDidSaveNotification
#2449
Conversation
In iOS 10 beta 4 there is another key in the `userInfo` dictionary, `managedObjectContext`, so the collection operator causes a crash as it assumes all values are `NSSet`s. I have added explicit checking for inserted, deleted and updated objects.
it looks good to me 👍 |
@@ -24,6 +24,8 @@ | |||
|
|||
@class RKManagedObjectStore; | |||
|
|||
extern NSSet *RKSetOfManagedObjectIDsFromManagedObjectContextDidSaveNotification(NSNotification *notification); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just redeclare this in the test file, I don't think we should be exposing this as part of public API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe useful, an alternative is to put it into a private extension not exported in the public headers but imported into the test file rather than redeclare it, at least it's always in one place
Adding the definition immediately before the function in RKManagedObjectStore.m removes a “No previous prototype for function…” warning. Tests build by using `extern` with the same definition.
Thanks a lot for the comments. I'll add separate private {h,m} files for this function as @valeriomazzeo suggests, as that seems neater than what we currently have here. |
unionObjectIDs(objectIDs,notification.userInfo[NSDeletedObjectsKey]); | ||
|
||
return objectIDs; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my preference would be to leave the implementation inside RKManagedObjectStore.m
No problem – I've moved the impl into |
While I was there I noticed another header that should be private and added that ( |
@segiddins @valeriomazzeo : Any idea when the next release is scheduled? I'd like to incorporate this fix into my project and would want to do it off a patch release rather than a specific commit. |
Hi every one, then it fix will be in cocoapods? Now there version RestKit 0.27.0 but still:
|
@NelepovDmitry : They haven't released a version with the fix. You can try this in your Podfile:
|
I also see this warning in the debugger:
I dont really understand, is this just a warning? Or has something indeed failed? Everything seams to be working... :S |
I used this commit |
…cation` (RestKit#2449) * Use specific `userInfo` keys In iOS 10 beta 4 there is another key in the `userInfo` dictionary, `managedObjectContext`, so the collection operator causes a crash as it assumes all values are `NSSet`s. I have added explicit checking for inserted, deleted and updated objects. * Expose function for testing * Add test case * Remove function from public interface Adding the definition immediately before the function in RKManagedObjectStore.m removes a “No previous prototype for function…” warning. Tests build by using `extern` with the same definition. * Add header for private function used in test * Move implementation into RKManagedObjectStore.m * Specify private headers in Podspec
in what version of restKit it will be included avaiable from cocoapods? |
We need this fix as soon as possible ready on CocoaPods |
This will come with https://github.com/RestKit/RestKit/issues/2459 correct? |
If anyone can confirm I didn't really follow on #2459 Does this pull request fixes it? |
@valeriomazzeo Yep, it does seem to resolve the exception issues for me! Hotfix release would be appreciated! |
👍 for the hotfix release! |
@SandyChapman and @RustamKhisamov : I used the commits you had specified, but still the issue persists. Initially I tried updating the pod to the latest version, but that didn't work. I had to modify the code directly in RKManagedObjectStore.m and add the header file RKMappingOperation_Private.h. Only then it worked. Is there any other commit that works? |
This fixed for me: But it would be really good to have a stable version. |
@zsoltbalint : If it makes you feel any better, that commit is identical to the 0.27.0 release with the addition of the single fix required. |
Thanks @SandyChapman , for clarification! 👍 |
* development: New changes to CocoaPods (RestKit#2443) Use explicit `userInfo` keys for `NSManagedObjectContextDidSaveNotification` (RestKit#2449) # Conflicts: # Code/CoreData/RKManagedObjectStore.m
…cation` (RestKit#2449) * Use specific `userInfo` keys In iOS 10 beta 4 there is another key in the `userInfo` dictionary, `managedObjectContext`, so the collection operator causes a crash as it assumes all values are `NSSet`s. I have added explicit checking for inserted, deleted and updated objects. * Expose function for testing * Add test case * Remove function from public interface Adding the definition immediately before the function in RKManagedObjectStore.m removes a “No previous prototype for function…” warning. Tests build by using `extern` with the same definition. * Add header for private function used in test * Move implementation into RKManagedObjectStore.m * Specify private headers in Podspec
Can we have a CocoaPods release with this wonderful fixes? |
To fix this problem: RestKit/RestKit#2449 (comment) Hopefully a real version will be released at some point. This required me to update cocoapods like so before running pod install: https://stackoverflow.com/questions/39980096/xcode8-cocoapods-abort-trap6/40438232#40438232
Any news on when the new version with this fix will be available? |
Seems like Rest.Kit is somewhat dead ... |
pod 'RestKit', :git => 'https://github.com/RestKit/RestKit.git', :commit => '13d98d5a6a5e06656ad040013dcae149b7cf8b99' It fixed my all issues with RestKit by upgrading to XCode 8 from XCode 7. Thanks guys. 👍 |
Such a critical fix should have already been released :-( |
Again: looks like RestKit died the typical open source death. Rest In Peace. It's sad to see, but developers move on, especially when they earn no money. |
see #2466 |
@segiddins I see that with #2466, you are hinting to a 0.27.1 realease. However, this PR is long overdue and not merged into the master. There is maybe an error with Travic CI, but "some" maintainer should take it as a starting point and make the final step. The next sentences may sound harsh and I feel sorry in advance (as I really understand those situations): If you (or someone else) does not have the time to maintain the component please state this publicly by making RestKit deprecated. Maybe this also helps bringing other people to the project. |
In iOS 10 beta 4 there is a new key in the
userInfo
dictionary,managedObjectContext
, so the existing collection operator causes a crash as it assumes all values areNSSet
s.I have added explicit checking for inserted, deleted and updated objects.