SyncEngine (CloudKit) fetching unwanted zones #343
Replies: 3 comments 1 reply
-
|
Hi @mahee96, we did not really have your use case in mind when building SQLiteData. The Can you explain more why you are separating records by device type? |
Beta Was this translation helpful? Give feedback.
-
|
my use case was limited and was mostly exploratory for device specific sync. ex: I wanted to have cloudKit isolation during syncing based on device type purely for isolating environments. lets say an app which runs on iOS can go to zone = iPhone and same app when ran on macOS zone = macOS, I can pass a dynamically generated value for "defaultZone" as u have pointed out correctly. which is how it works currently matching the snippet I showed, so creation/upload works as expected (data goes into respective zones). Now regarding download/fetch part, instead of fetching the active/default zone passed to engine, I got data from other zones or all zones too. Use case Flow:
But it didn't adhere to strict zoning, that is, it pulled unwanted zone's data. I checked cloudKit db and it showed properly 2 zone created for same container as expected, but data was almost same on both zones though I was expecting an empty zone, coz MacOS app installation didn't do any useful work yet (it didn't generate its own data)
I felt it did a cross zone sync and seemed to be a bug coz, it felt it was polluting data now, by merging both zones without consent. I am new to cloudKit too in general so if my understanding of this zone fetch was wrong and it was working as expected, then we don't have any issue. That's why I asked it here. I could have done this in a different way too, by creating multiple containers completely isolated for device type. but since zoning was already available, I tried to use and keep it in same container and not pollute my CK db entries. this way I could keep cross-device-sync as on-demand facility or give user a chance to keep iOS and macOS data completely separate without change in DB Schema to account for device variant types. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the explanation, yeah, agree that the engine should mimic CK API behavior, thanks for quickly getting back on this, much appreciated! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team, Thanks for the great library which also provides CloudKit syncing.
I have 1 question though, because I have a case where I wanted to keep the data from individual device types to be separately synced though under same container since all are under same app bundle.
in this case, when I tried to first freshly load up my app on iPhone and SyncEngine synced data into CK db, and I tried to install same app on Mac (designed for iPad mode) on Mac, the data from iPhone zone was also merged into Mac app's db
is this intentional, or is there something I am missing here. is Zone isolation for fetch+write not possible?
Beta Was this translation helpful? Give feedback.
All reactions