simperium

simperium: sqlite database restored to Xcode Simulator (Xcode 7.1.1). new records sync. old records don't


Question for Simperium:

A badly-written XC unit test wiped most data from a simperium user account (mine.) No problem. I moved a day-old back-up of the sqlite file into an iPhone 5 (iOS 9.1) simulator, and deleted the now-useless sqlite file from the same Documents directory.

I performed a clean (SHIFT-COMMAND-K), and started the simulator. All my missing data now appeared in the app simulator. Great.

BUT restored Core Data records did not then get synced to corresponding Simperium buckets. Puzzling as Simperium DID respond successfully to syncing new records on create, update, and delete actions.

I then deleted the entire data set on Simperium.com. Same result. New records syncing no problem, old records no.

Is there important meta-data that I deleted when deleting the old sqlite file. If so, (how) can I get old records to re-sync?


Solution

  • What's going on is: the method that should pick up those 'new old entities' is getting bypassed, because all of them already have both, a Key + GhostData.

    This scenario should normally recover automatically, granted that those entities get updated somehow (that way the lib would pick them up and sync them with the backend).

    The easiest way to force a re-upload would be:

    (Untested), but that should do the trick!