Improve log message
authorHannah von Reth <hannah.vonreth@owncloud.com>
Fri, 27 Nov 2020 11:00:46 +0000 (12:00 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:18 +0000 (10:59 +0100)
src/libsync/discovery.cpp
src/libsync/discoveryphase.cpp

index 8c2ebc155676867037a2d6ad0939eb815f8cc9be..89bdf70cedd085d486465987f73ff36d42fb4449 100644 (file)
@@ -1224,11 +1224,11 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item)
             return true;
         }
         if (!perms.hasPermission(RemotePermissions::CanWrite)) {
-            qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file;
             item->_instruction = CSYNC_INSTRUCTION_CONFLICT;
             item->_errorString = tr("Not allowed to upload this file because it is read-only on the server, restoring");
             item->_direction = SyncFileItem::Down;
             item->_isRestoration = true;
+            qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file << item->_errorString;
             // Take the things to write to the db from the "other" node (i.e: info from server).
             // Do a lookup into the csync remote tree to get the metadata we need to restore.
             qSwap(item->_size, item->_previousSize);
@@ -1244,12 +1244,11 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item)
             forbiddenIt -= 1;
         if (forbiddenIt != _discoveryData->_forbiddenDeletes.end()
             && fileSlash.startsWith(forbiddenIt.key())) {
-
-            qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file;
             item->_instruction = CSYNC_INSTRUCTION_NEW;
             item->_direction = SyncFileItem::Down;
             item->_isRestoration = true;
             item->_errorString = tr("Moved to invalid target, restoring");
+            qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file << item->_errorString;
             return true; // restore sub items
         }
         const auto perms = item->_remotePerm;
@@ -1258,11 +1257,11 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item)
             return true;
         }
         if (!perms.hasPermission(RemotePermissions::CanDelete)) {
-            qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file;
             item->_instruction = CSYNC_INSTRUCTION_NEW;
             item->_direction = SyncFileItem::Down;
             item->_isRestoration = true;
             item->_errorString = tr("Not allowed to remove, restoring");
+            qCWarning(lcDisco) << "checkForPermission: RESTORING" << item->_file << item->_errorString;
             return true; // (we need to recurse to restore sub items)
         }
         break;
index 24090197f9ad0491c46bcb9e89fd70c5efcddadf..24b4fb155237f092b5b96d0d39b125a50fe24e33 100644 (file)
@@ -173,7 +173,7 @@ QPair<bool, QByteArray> DiscoveryPhase::findAndCancelDeletedJob(const QString &o
                     || ((*it)->_type == ItemTypeVirtualFile && instruction == CSYNC_INSTRUCTION_NEW)
                     || ((*it)->_isRestoration && instruction == CSYNC_INSTRUCTION_NEW)))
             {
-                qCWarning(lcDiscovery) << "OC_ENFORCE(FAILING)";
+                qCWarning(lcDiscovery) << "ENFORCE(FAILING)" << originalPath;
                 qCWarning(lcDiscovery) << "instruction == CSYNC_INSTRUCTION_REMOVE" << (instruction == CSYNC_INSTRUCTION_REMOVE);
                 qCWarning(lcDiscovery) << "((*it)->_type == ItemTypeVirtualFile && instruction == CSYNC_INSTRUCTION_NEW)"
                                        << ((*it)->_type == ItemTypeVirtualFile && instruction == CSYNC_INSTRUCTION_NEW);