ios icon indicating copy to clipboard operation
ios copied to clipboard

Files edited outside of NC iOS app are not synced towards other apps using the edited file

Open Pit-Storm opened this issue 9 months ago • 1 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Edit a file in an app which pushes the changes over webdav.
  2. Open the changed file in another app where the file is added via iOS File Explorer (FileProvider)
  3. Notice the differences of the files
  4. Check out the iOS Files app: The edited file vanishes shortly after opening the app
  5. If you open the NC iOS App and wait a couple of seconds, the file is again visible in the iOS Files app and shows correctly in the app from step 2.

Expected behaviour

The NC iOS app should push / trigger an update of the edited file towards the iOS NC FileProvider in the background. So, that a new app can open the updated file.

Actual behaviour

The file isn't synced back towards the iOS FileProvider unless the NextCloud app is opened / brought to front.

Logs

If applicable, you can post the iOS app or server logs (removing any sensitive information).

Reasoning or why should it be changed/implemented?

It is convenient that NC iOS App keeps files in iOS File browser up to date. So, other application can get the latest version of the file without open the NC app all the time.

Environment data

iOS version: 18.3.2

Nextcloud iOS app version: 6.5.0.5

Server operating system:

Web server: Apache, nginx

Database:

PHP version:

Nextcloud version: 29.0.9

Pit-Storm avatar Apr 03 '25 14:04 Pit-Storm

Background tasks are turned on systemwide and for nextcloud.

Also I found several other issues that mention a behavior similar to this: Android/#19 #3186 #3156 #2953 #2443

Recomendation to fix this: Since iOS 16 there is another way to implement the FileProvider. See: https://developer.apple.com/documentation/fileprovider/nsfileproviderreplicatedextension

The NSFileProviderReplicatedExtension might make sense in the use case of NC for iOS, because you don't want to take care of files on the file providers file system. The NC FileProviderExtension just should take care of xyncing the files properly. As far as I understood the code there a couple of updates needed, but this can help solving several issues with file syncing that had been edited in other apps through the iOS File explorer.

Also it might be good to add files to the WorkingSet in NSFileProviderEnumerator that has been marked as "Available offline". So it is convenient that those files (like favorites) are always stay in sync until the internet connection is lost.

Also wit the new way of syncing items through NSFileProvidedReplicatedExtension it's possible to keep track of materialized and non materialized items (as far as I understood, that's new). So, NC iOS App keeps track of changes through those items, and if there is a change it triggers an update of the local copy of the item through the fileProvider in the background.

I don't know (searched for it, but couldn't find) if you guys want to include devices older than iOS 16. In that case this change would not yet be possible, but it's really worth taking this change the replicated provider implementation into account, because it will boost user experience to a whole new level.

Pit-Storm avatar Apr 03 '25 14:04 Pit-Storm