I've read in another answer that Simperium should be able to handle Core Data lightweight migrations fine. However, I'm currently struggling with the simple case of adding an (optional) property to an existing entity.
To make the issue a bit easier to follow, let's go through an example. Let's say that my previous app version is 1.0 and a new version 1.1 introduces a new property foo on a Core Data entity.
Now, let's consider this scenario:
- Device A and B both run version 1.0 and are attached to the same Simperium sync account, both up-to-date.
- Device A upgrades to version 1.1, the property is created in the data base, and the user adds some data to the new
fooproperty. This data is correctly synced to the Simperium backend andfoois visible in the web data browser. - Device B (still on version 1.0, i.e. without
foo) syncs with Simperium. At this point I seeSimperium warning: applyDiff for a member that doesn't exist, which is understandable becausefoodoes not exist. Everything still expected and fine here. - Now device B upgrades to 1.1. When starting the app for the first time, Core Data creates the new
foocolumn. However, now that thefooproperty is there, Simperium still does not pull its data from the backend, so devices A and B don't see the same data forfoo!
I understand why this happens (Simperium has discarded the change the first time, because the property wasn't there yet, and then doesn't apply the same change again later when it could). However, I think this is quite problematic and effectively makes even the simplest changes to the data model very risky. Am I missing anything here? What would be a safe way to add a new property to an entity?