MacOS FileProvider: Creating persistent identifiers for remote files to use with NSFileProviderReplicatedExtension

I'm working on a file provider extension that maps to a cloud service. The remote service represents files using paths, directories and filenames (unsurprising). However, the NSFileProviderReplicatedExtension wants persistent identifiers for every item (file or folder).

What's the best practice here? I naively thought I could just use the URL as the identifier, but that breaks down as soon as items are moved - the URL changes, which would mean the identifier does too.

Is it necessary to maintain some kind of mapping in the extension? Does this have to be persisted somehow, or can it be in-memory only? If it's persistent, how would one typically do this?

Thanks for any insight!

Note that the Apple sample code isn't all that helpful here. The webservice their extension is accessing provides identifiers for every item already, which isn't typical of most cloud file storage.

Given the service I'm accessing only provides path, file/folder name, and content (for files), I almost wonder if it'll hurt to just keep changing the identifiers and avoid maintaining a mapping. I can return a new item with a new identifier from calls to modifyItem(...), and then return NSFileProviderError(.noSuchItem) for future access to the old identifier. I just don't know if that'll mess things up in ways I don't yet understand.

Can any one from Apple clarify this? @clenart?

I have the same problem, the cloud storage service i'm accessing only uses paths, there are no persistent identifiers.

MacOS FileProvider: Creating persistent identifiers for remote files to use with NSFileProviderReplicatedExtension
 
 
Q