How to retrieve previously set title for a CKShare?

I create a CKShare and then I set the title:

share[CKShare.SystemFieldKey.title] = title

I even call:

if let cloudStore = coreDatabase.cloudStore {
            try await persistentContainer.persistUpdatedShare(share, in: cloudStore)
        }

but when I retrieve this share again using

persistentContainer.fetchShares(matching: [id])

the title is not set. I even checked CloudKit console and I can't see there title either...

How can I retrieve the previously set title for a share?

It turns out that CoreData+CloudKit cannot preserve custom key-value pairs from CKShare either. It works for a couple of seconds and then the NSPersistentContainer stops returning both title and custom key-value pairs even though they are available in CloudKit Console...

I can't believe how buggy CloudKit integration is. It's a bug after bug, 20% of the integration are workarounds and hacks to fix faulty CloudKit+CoreData behavior... And this SDK is available since 2019 O_O. This should never leave beta at this state...

Reported: FB14916959

How to retrieve previously set title for a CKShare?
 
 
Q