Files Provider Extension Domain:Process mapping

Hi

We have a non-replicated Files Provider extension on iOS that creates multiple domains. I've noticed that iOS typically creates one process per domain, so I would assume that each process is meant to handle one domain. However, in practice, is seems that calls for any domain can occur in any process.

I'm wondering whether there is supposed to be a mapping, implying there might be something wrong with the code, or whether we shouldn't make assumptions about domain:process mapping.

Thanks for any info you can provide.

I do notice that the documentation says:

"A new NSFileProviderExtension object is created for each domain added to the File Provider manager. The new File Provider’s domain property is set to the added domain, and any items returned by the File Provider belong to that domain."

However, I won't assume that every new NSFileProviderExtension object is in a new process, because that is an implementation details of the system, and hence is subject to change.

I am curious why you need to rely on the domain:process mapping though, if you don't mind to share.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

I am curious why you need to rely on the domain:process mapping though, if you don't mind to share.

Thanks for the response! We don't need to rely on domain:process mapping, but I'm trying to understand what we can rely on. For example, each domain is a separate account - things like cookies, caches, etc are probably not to be shared across accounts.

I'm looking at the header for NSFileProviderDomain right now, and I see this comment:

On the extension side, a separate instance of NSFileProviderExtension will be created for each @c NSFileProviderDomain registered. In that case, the @c NSFileProviderExtension.domain properties will indicate which domain the NSFileProviderExtension belongs to (or nil if none).

This is what led me to believe that all of the calls for a particular domain would be routed to a single process. I'm finding that not to be the case - calls for any domain can come to any Files Extension process, which would seem to contradict that comment as I understand it. Is that as expected?

Files Provider Extension Domain:Process mapping
 
 
Q