New: Field-level CloudKit record merging #95
Replies: 2 comments 3 replies
-
|
In your changes you added a bunch of 'ON CONFLICT REPLACE' statements to some of the ReminderList fields. Is that a necessary change for my schemas as well to work with the field level conflict solution? |
Beta Was this translation helpful? Give feedback.
-
|
Is there an API to choose between record vs field level resolution? For a reminder the field level makes sense. But, if I have a record with a start and end time, where I want the invariant of start time < end time it could be an issue. Start: 10:00 Device A: Device B: After merging: Maybe this problem could be avoided with a start time and duration data scheme. But I'm not sure this works for all data schemes where there's some invariants. I think it should per entity to decide whether it's suitable for field / column or record / row resolution. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Important
The changes released today are breaking and may be incompatible with CloudKit containers created for earlier versions of the alpha. If you experience any issues with the update, try rotating your CloudKit container to a fresh one to see if the issue is resolved.
Today we introduced a new feature to our CloudKit alpha branch: field-level record merging.
Previously, sync events took a last-wins approach, where if device A and device B update a record before they receive each other's updates, the record sent from the last device would write over the changes sent from the first device.
For example:
This is no longer the case. Our CloudKit tools now track when specific fields are updated and moves the last-wins approach to the field level.
In the above case:
We may further support custom conflict resolution strategies in the future, but for now we hope this addresses a scenario that could be common, especially for records that are shared with other participants.
Beta Was this translation helpful? Give feedback.
All reactions