File Provider Extension Remote Server Change Apply Error

Hi all, i am trying to implement File Provider Extension. I was able to enumerate remote storage directories to local via 'enumerateItems' function of NSFileProviderEnumerator.

I can apply remote storage changes like newly created files/folders, move, rename and delete operations and successfully apply them to local with 'NSFileProviderChangeObserver' class 'didUpdate' and 'didDeleteItems' functions.

However when file content is updated on remote server;

  1. If file content is not fetched(file is Dataless), i can not apply this change to local. When i call 'NSFileProviderChangeObserver' class 'didUpdate' function for changed file, only DateModified attribute is updated on finder, file size is not changed to new size.
  2. If file content has been fetched, When i call 'NSFileProviderChangeObserver' class 'didUpdate' function nothing is changed, file content stay depreciated

Any suggestion how to fix it?

Answered by Engineer in 827698022

When the item content is changed remotely, you should signal the working set, and enumerate an NSFileProviderItem on the working set with a different -[NSFileProviderItem itemVersion], changing the contentVersion to a different value than before.

The behaviors regarding remote file content updates are also influenced by the -[NSFileProviderItem contentPolicy].

Regarding your first point, are you changing the documentSize on the item when you enumerate the updated item metadata on the working set?

Accepted Answer

When the item content is changed remotely, you should signal the working set, and enumerate an NSFileProviderItem on the working set with a different -[NSFileProviderItem itemVersion], changing the contentVersion to a different value than before.

The behaviors regarding remote file content updates are also influenced by the -[NSFileProviderItem contentPolicy].

Regarding your first point, are you changing the documentSize on the item when you enumerate the updated item metadata on the working set?

File Provider Extension Remote Server Change Apply Error
 
 
Q