Log state before specific assertion
authorHannah von Reth <hannah.vonreth@owncloud.com>
Fri, 27 Nov 2020 10:26:41 +0000 (11:26 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:16 +0000 (10:59 +0100)
src/libsync/discoveryphase.cpp

index 39004ab73f09a022829a4603c65b4e0ab745cd4c..51e0e15fd39b99fd3ecd1c3885844215142fc01c 100644 (file)
@@ -168,11 +168,22 @@ QPair<bool, QByteArray> DiscoveryPhase::findAndCancelDeletedJob(const QString &o
             result = true;
             oldEtag = (*it)->_etag;
         } else {
-            ENFORCE(instruction == CSYNC_INSTRUCTION_REMOVE
-                // re-creation of virtual files count as a delete
-                || ((*it)->_type == ItemTypeVirtualFile && instruction == CSYNC_INSTRUCTION_NEW)
-                || ((*it)->_isRestoration && instruction == CSYNC_INSTRUCTION_NEW)
-                );
+            if (!(instruction == CSYNC_INSTRUCTION_REMOVE
+                    // re-creation of virtual files count as a delete
+                    || ((*it)->_type == ItemTypeVirtualFile && instruction == CSYNC_INSTRUCTION_NEW)
+                    || ((*it)->_isRestoration && instruction == CSYNC_INSTRUCTION_NEW)))
+            {
+                qCWarning(lcDiscovery) << "OC_ENFORCE(FAILING)";
+                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);
+                qCWarning(lcDiscovery) << "((*it)->_isRestoration && instruction == CSYNC_INSTRUCTION_NEW))"
+                                       << ((*it)->_isRestoration && instruction == CSYNC_INSTRUCTION_NEW);
+                qCWarning(lcDiscovery) << "instruction" << instruction;
+                qCWarning(lcDiscovery) << "(*it)->_type" << (*it)->_type;
+                qCWarning(lcDiscovery) << "(*it)->_isRestoration " << (*it)->_isRestoration;
+                ENFORCE(false);
+            }
             (*it)->_instruction = CSYNC_INSTRUCTION_NONE;
             result = true;
             oldEtag = (*it)->_etag;