Description
My app uses the following model to save objects.
saveAnObject (PFObject *obj)
{
// save locally first
//
[obj pinInBackgroundWithBlock:^(BOOL success, NSError *error)
{
if (success == true)
{
// local save succeeded - now save to cloud
[obj saveEventually];
}
else
{
// local save failed
//
.... do error processing ....
}
}];
}
However, after reading this http://stackoverflow.com/questions/32617917/parse-saveeventually-failing-when-app-is-terminated-quickly and then reading the parse ios/osx code on github it appears that saveEventually returns after allocating a task and (important) prior to writing anything to disk. In other words it seems quite possible that a saveEventually could fail silently if an app is killed prior to the task allocated having a chance to persist the "save to cloud" request.
True?
If so, this probably explains why I occasionally see objects in my local store that are never persisted in the cloud. From the documentation I concluded that saveEventually was persisting / logging the save request to disk prior to returning control to the application.... ie. classic write-ahead logging to ensure the data was not lost in the event of untimely app termination.
Assuming the above is true, is there any way for me to query the local datastore to determine if there is data that has not yet been persisted to the cloud (ie. to detect saveEventually failures?).