0

Went through the iOS tutorial, seems like Simperium works much like iCloud Core Data in that it transparently syncs in the background and writes changes into the underlying persistent store AND merge to changes into the current managed object context. I believe this is how the todo list sample app works, because the NSFetchedResultsController would detect changes in its managed object context automatically.

But my question is, is there any API for detecting conflict that could occur? This is actually a two part question. First, is there any conflict that Simperium can't handle and report to the application to handle in a custom way? Second, let's say I have a constraint, which is actually implemented as a Core Data validation method, that, for example, ensures the sum of the amount of child items equals the amount of their parent item (don't ask me why, it's just how it has to be in my app), when Simperium sync changes from multiple devices, there could be case where both device edit the child item in such a way that the sum of the child item no longer equal the parent item's amount. Would Simperium write the invalid data into my persistent store? (i.e. bypass my Core Data validation). Or, would it somehow report the validation error to me and let me resolve the conflict within the application?

Would love to use Simperium if it can handle these cases.

1 Answer 1

0

There's currently no API for detecting conflicts, since Simperium is designed to resolve conflicts automatically, particularly for NSStrings.

We realize the defaults don't work for all use cases though, and the system is designed to support server-side schemas that allow you to override default conflict resolution for various types. For example, you could specify a Number that "merges" by always adding values instead of replacing them. This isn't ready yet though.

In the meantime, Core Data validation should work as long as you're only syncing between iOS and Mac clients. Simperium ultimately calls save on your NSManagedObjectContext just like anything else, so it should trigger the validation. My advice would be to try this (Simperium doesn't take much effort to integrate) and let us know if you encounter problems by adding an issue on GitHub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.