Question about NSPersistentCloudKitContainer and sharing

Hopefully everyone's recovered from WWDC2021 last week!

I've been digging through as much of the new documentation as I can about the NSPersistentCloudKitContainer and sharing over the last couple of days (since I can't get my code working in the XC 13 Beta... looks like a couple of bugs, I think...), and have a question.

It appears that this uses Sharing by Record Zone rather than Sharing by Record, which is fine, but...

How does this work when you are sharing entities between multiple users? for example...

My Db contains a hierarchy of entities under a single root node, and there are multiple such entities (at the moment without overlap between the sub-entities, but I feel like that's just around the corner).

Lets call them Entities A, B, and C.

Now:

  1. Entity A I want to share with Joe.
  2. Entity B I want to share with Joe and Sally.
  3. Entity C I want to share with Sally and Simon.

So, for Entity A I presume that it (and it's sub entities) wind up being represented in a shared record zone (SRZ) of it's own.

Entity B winds up being represented in another, separate SRZ.

Entity C winds up being represented in yet another SRZ.

So... now if I delete the share for Sally on Entity B, does it remain in its own SRZ?

And... if I'm right about this, how is the proliferation of new SRZ's managed within CloudKit Dashboard - very quickly the SRZ space could become seriously bloated and unmanageable...

Thoughts?

Question about NSPersistentCloudKitContainer and sharing
 
 
Q