From 8c3749cbe2eaa9792ec19b00af39ad61801b9d89 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Fri, 27 Nov 2020 11:26:41 +0100 Subject: [PATCH] Log state before specific assertion --- src/libsync/discoveryphase.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 39004ab73..51e0e15fd 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -168,11 +168,22 @@ QPair 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; -- 2.39.5