deeje / CloudCore

Robust CoreData-CloudKit synchronization: offline editing, relationships, private, shared and public databases, field-level deltas, encrypted values, cacheable assets, and more.
MIT License
157 stars 17 forks source link

Ignore syncing individual attributes? #20

Closed dippnerd closed 2 years ago

dippnerd commented 3 years ago

Is there some way I could mark certain attributes to not sync to CloudKit? I have an "order" field for sorting items, but want each device to be able to sort on its own. Any advice would be appreciated, thanks!

deeje commented 3 years ago

Hmm, field-specific masking sounds like a whole new feature, where the conversion from managed object to CloudKit record takes into account a list of fields to ignore.

Short of that, one approach would be to define a new entity type that just contains the order and a weak reference (e.g. uuid) to the original item, and with no CloudKit sync info. But then you'd need to detect when new items are received to then generate local sort entities for them.

I'm curious what the use case is for this?

dippnerd commented 3 years ago

I'm not sure how else to store the order of items on a sortable list. The user can manually rearrange items so I need to record that somehow but I want them to be able to manually sort across different devices without it syncing that order. Field masking seems like the easiest solution but maybe there's a method I'm not considering?

deeje commented 2 years ago

@dippnerd fwiw, I finally got around to maskable attributes as part of cacheable assets, see PR #28