Saving a file to ubiquitous storage overwrites iCloud version without conflict

Our app saves its data to iCloud by default. In most cases, this is working as intended & the data can be synced across devices with no problems.

But recently, in testing, we discovered a situation where it's possible to save data before the NSMetadataQuery finishes & starts downloading the cloud files. When this happens, the query will then finish, and return the NEW file (with no other versions or conflicts).

Is there a way to ensure that writing a file (version A) to ubiquitous storage when another version (version B) exists in the cloud is treated as a conflict, rather than just stomping all over the other version?

I've tried querying the file metadata for the file URL (NSURLIsUbiquitousItemKey, NSMetadataUbiquitousItemDownloadingStatusKey, NSURLUbiquitousItemDownloadRequestedKey, NSURLUbiquitousItemHasUnresolvedConflictsKey) before saving, but it just returns nil.

Saving a file to ubiquitous storage overwrites iCloud version without conflict
 
 
Q