As @platypus mentions, here are a few thoughts from my POV as a Mac developer.
To start with, we need to understand that iCloud was primarily designed for use with Apple’s concept of Documents, which are essentially a “folder” with various data held within, commonly referred to as a “bundle”. The file system sees that bundle as a single entity, so any changes to anything within that bundle trigger a notification that the bundle has changed, in much the same way as an ordinary file.
PhotoLab works with either two or three separate files - the image, a DOP sidecar and an XMP sidecar.
As @platypus has proven, if you remove an image file, using Finder, whilst PL is looking at the containing folder, PL detects that and deletes any associated sidecar files.
The problem that @myneur raised stems from trying to edit image files that were stored, apparently, on either the Desktop or Documents folders.
Except that, because he had configured, unknowingly, those folders as part of what Apple calls iCloud Optimisation. This means that macOS keeps an eye on how full the primary disk is and, if it is approaching full, files in those folders will be synchronised to the user’s iCloud storage and removed from those two folders.
Which files get transferred depends on things like their size and how frequently or recently they were touched (edited).
If you are editing an image in PL, the image file itself never gets touched because PL is a non-destructive editor, but the DOP and XMP files will get touched as adjustments are made. This means that the image file (which can be quite large) is far more likely to be left in your iCloud storage and deleted from the primary disk when optimisation is triggered. Whereas, the smaller sidecar files are both recently touched and a lot smaller, rendering them much less likely to be removed to save space.
If you look in the ~/Library/Mobile Documents
folder on you computer, you will find the locally cached versions of the files you have placed on your iCloud Drive.
If you have chosen to include the Desktop and Documents option in Cloud Optimisation, this is where the system keeps a local copy of everything you see on your Desktop. But only if there is enough room on your disk. And it is these specially managed local copies of Desktop and Documents that are susceptible to appearing to lose files when the disk is too full - your original files are always kept on your iCloud Drive.
So, if you allow PhotoLab to access image files from your Cloud Optimised Desktop folder, you can never be guaranteed to be able to access it after opening it, because it may have been removed from the local cache. If this happens, it is the same as removing an image from a regular folder whilst PhotoLab can see that folder.
Now we all know that you should never manage files in regular folders whilst PL is open - all sorts of things can happen. Well, the same applies to iCloud folders but with the added “danger” of the system removing files to recover disk space as part of Cloud Optimisation.
So, should DxO do something about this?
In conversation with @platypus we feel that selecting a Cloud based folder:
- should be possible but with a warning that your work is at risk
… or…
- should be prevented with the same kind of preference that hides package contents for things like the photos and PhotoBooth libraries.
It is for these reasons that it is highly recommended to never use your Desktop and Documents folders for storing images if you have allowed Cloud Optimisation.
Or, actually, never use your Desktop or Document folders for images, since macOS provides a Pictures folder that is never included in optimisation.
Oh, and never let you primary drive get more than half full. If you need more space, use a USB-C SSD, which will usually react as quickly as the internal drive.