ubiquitousItemIsExcludedFromSync

I discovered ubiquitousItemIsExcludedFromSync in the list of supported URL resource keys, but found very few little doc about it.

The resource is r/w, however setting it will never return: the program will be stuck in an XPC call that never returns (tested on macOS 11.6 and 12 RC).

Does anybody have any info on this?

Thanks

I discovered .ubiquitousItemIsExcludedFromSync

This isn’t something I have an experience with.

the program will be stuck in an XPC call that never returns

Hmm, that’s not good. Can you post a backtrace of that hang?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Tell me if there’s a better way, in the mean time, here’s a screen of the backtrace (nothing’s happening in thread 2).

The code is dead simple:

do {
	logger.debug("Treating path \(p)")
	var url = URL(fileURLWithPath: p)
	let rv = try url.resourceValues(forKeys: [.ubiquitousItemIsExcludedFromSyncKey])
	logger.info("Excluding \(p)")
	var newRv = rv
	newRv.ubiquitousItemIsExcludedFromSync = true
	try url.setResourceValues(newRv) /* <- Hangs here */
} catch {
	logger.error("Error treating path \(p): \(error)")
}

A possibly interesting note: it seems the ubiquitousItemIsExcludedFromSync value is never filled (it is nil after the resourceValues call)

Thanks for the backtrace. Clearly this is using XPC to invoke a file provider but that’s about all you can tell from that info. Someone is going to have to look at this in depth, more depth than is possible in the context of DevForums. My recommendation is that you open a DTS tech support incident so that I, or more likely, one of my colleagues, can do that.

Having said that, the fact that this hangs is definitely bugworthy, so I’d recommend that you start by filing a bug about that. Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Bug filed: FB9733892

Bug filed: FB9733892

Thanks for that.

Looking at your bug it’s clear that two issues are interacting here. First, iCloud Drive does not support .ubiquitousItemIsExcludedFromSync. Second, that lack of support causes the code within setResourceValues(…) to take a wrong turn and hang.

We’re using your bug to track the second issue. Once that’s fixed this call will return an error rather than hang.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

ubiquitousItemIsExcludedFromSync
 
 
Q