Why are unsynchronised File Provider files not moved to Trash when deleting a domain

I’m trying to understand the intended macOS File Provider behavior when unsynchronised local files exist inside a provider volume that gets deleted.

Scenario:

  1. A local file is moved (not copied) from a normal filesystem location into a File Provider-backed cloud volume.
  2. The provider is disabled/offline or upload is pending, so the file has not yet synchronised to the cloud.
  3. The File Provider volume/domain is then deleted from Finder and the deletion is confirmed.

In this situation, the unsynchronised file appears to be lost entirely instead of being moved to ~/.Trash.

My question is:

Why doesn’t macOS preserve unsynchronised local content by automatically moving it to Trash before removing the File Provider domain?

From a user perspective, Finder presents the provider volume as a normal filesystem hierarchy, so deleting the volume feels equivalent to deleting a local folder or mounted drive, where local-only files would normally be recoverable via Trash.

Is the current behavior expected because:

  • File Provider storage is treated as provider-managed cache rather than canonical filesystem data?
  • Finder delegates deletion semantics entirely to the provider extension?
  • The backing files may not exist as normal files at deletion time?
  • Or are providers expected to implement their own recovery/trash logic?

More generally:

  • Is there an Apple-recommended pattern for preventing loss of unsynchronised files during domain removal?
  • Are providers expected to retain pending uploads somewhere recoverable?
  • Is there any supported API for preserving unsynced local items before deleting a domain?

I’m asking because this behavior can easily lead to unexpected data loss when users assume Finder trash semantics apply to File Provider volumes.

We appreciate your interest in participating in the forums! These forums are for questions about developing software and accessories for Apple platforms. Your question seems related to a consumer feature and not even iCloud as you referenced a file provider cloud? and is better suited for the Apple Support Communities or the 3rd party cloud provider support?

https://discussions.apple.com/welcome

Albert
  Worldwide Developer Relations.

When a file provider extension is disabled via the Settings app (Settings > General > Extensions), the system notifies the extension by calling its invalidate(), and the extension can handle the unsynchronized files from there.

When a file provider domain is deleted via an app, the app will eventually trigger remove(_:completionHandler:) or remove(_:mode:completionHandler:). In iOS, deleting a domain deletes all the files. In macOS, the app can keep downloaded files or files that contain unsynchronized local changes by specifying a removal mode (NSFileProviderManager.DomainRemovalMode).

If you are the developer of a file provider, you can implement your own behavior using the mentioned APIs. Otherwise, you might want to contact the owner of the file provider you use to see what they can do for you.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Why are unsynchronised File Provider files not moved to Trash when deleting a domain
 
 
Q