I'm trying to handle the serverRecordChanged
return code you get in CKError
when you have a conflict and your using the savePolicy
of ifServerRecordUnchanged
.
According to the CKError.Code.serverRecordChanged documentation, I should be receiving all three records that I need to do a 3-way merge. The problem is that the ancestorRecord
(CKRecordChangedErrorAncestorRecordKey can also be used to look it up in the userInfo
) doesn't actually contain a record. It only contains the record metadata.
Is there something I need to be doing to get the full ancestorRecord
in the CKError
?
If not is it possible to query iCloud for the ancestorRecord
? Given that iCloud has the change history (as I understand it), then it is theoretically possible. I just don't know how to do it if it is possible.
Are 3-way merges even possible? The design of the serverRecordChanged
looks like that is the intent, but I can't see how to do it with the data that CloudKit is providing.