prevent implicit hydration when checking PIN state
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 3 Jan 2025 14:34:07 +0000 (15:34 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 3 Jan 2025 16:14:45 +0000 (16:14 +0000)
to enable move to trash, we check availability of a folder recursively

that will trigger implicit hydration of its content

we will now prevent moving to trash for VFS CfApi native VFS on Windows

will fix teh bug and probably be much more robust and reliable

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/propagatorjobs.cpp

index 6d7a36c9404b64a25f17d8d8d31ce9b09503b47d..408d85623eaf633a52c6829091dd7ac9ac7fc5a3 100644 (file)
@@ -118,7 +118,7 @@ void PropagateLocalRemove::start()
 
     QString removeError;
     const auto availability = propagator()->syncOptions()._vfs->availability(_item->_file, Vfs::AvailabilityRecursivity::RecursiveAvailability);
-    if (_moveToTrash && (!availability || (*availability != VfsItemAvailability::AllDehydrated && *availability != VfsItemAvailability::OnlineOnly && *availability != VfsItemAvailability::Mixed))) {
+    if (_moveToTrash && propagator()->syncOptions()._vfs->mode() != OCC::Vfs::WindowsCfApi) {
         if ((QDir(filename).exists() || FileSystem::fileExists(filename))
             && !FileSystem::moveToTrash(filename, &removeError)) {
             done(SyncFileItem::NormalError, removeError, ErrorCategory::GenericError);