From 3e46fa47c5208aaf0a063d77720dfe5b4e0ef269 Mon Sep 17 00:00:00 2001 From: Christophe Larchier Date: Fri, 11 Oct 2024 17:20:08 +0200 Subject: [PATCH] Manage Inconsistency status --- .../propagation/executor/executorworker.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/libsyncengine/propagation/executor/executorworker.cpp b/src/libsyncengine/propagation/executor/executorworker.cpp index b7f3a0e2b..9bec2f5e2 100644 --- a/src/libsyncengine/propagation/executor/executorworker.cpp +++ b/src/libsyncengine/propagation/executor/executorworker.cpp @@ -173,6 +173,8 @@ void ExecutorWorker::execute() { if (!bypassProgressComplete) { if (ignored) { setProgressComplete(syncOp, SyncFileStatus::Ignored); + } else if (syncOp->affectedNode() && syncOp->affectedNode()->inconsistencyType() != InconsistencyType::None) { + setProgressComplete(syncOp, SyncFileStatus::Inconsistency); } else { setProgressComplete(syncOp, SyncFileStatus::Success); } @@ -383,7 +385,7 @@ void ExecutorWorker::handleCreateOp(SyncOpPtr syncOp, std::shared_ptraffectedNode()->name()).c_str()); hasError = true; @@ -447,7 +449,7 @@ void ExecutorWorker::handleCreateOp(SyncOpPtr syncOp, std::shared_ptrtargetSide() == ReplicaSide::Remote, _executorExitCause); - if (_executorExitCode != ExitCode::Unknown) { + if (_executorExitCode != ExitCode::Ok) { LOGW_SYNCPAL_WARN(_logger, L"Failed to convert to placeholder for: " << SyncName2WStr(syncOp->affectedNode()->name()).c_str()); hasError = true; @@ -536,7 +538,7 @@ bool ExecutorWorker::generateCreateJob(SyncOpPtr syncOp, std::shared_ptraffectedNode()->name()).c_str()); return false; @@ -573,15 +575,11 @@ bool ExecutorWorker::generateCreateJob(SyncOpPtr syncOp, std::shared_ptraffectedNode()->inconsistencyType() != InconsistencyType::None) { // Notify user that the file has been renamed SyncFileItem syncItem; if (_syncPal->getSyncFileItem(relativeLocalFilePath, syncItem)) { - status = SyncFileStatus::Inconsistency; - Error err(_syncPal->syncDbId(), syncItem.localNodeId().has_value() ? syncItem.localNodeId().value() : "", syncItem.remoteNodeId().has_value() ? syncItem.remoteNodeId().value() : "", syncItem.type(), syncItem.newPath().has_value() ? syncItem.newPath().value() : syncItem.path(), syncItem.conflict(), @@ -589,8 +587,6 @@ bool ExecutorWorker::generateCreateJob(SyncOpPtr syncOp, std::shared_ptraddError(err); } } - - _syncPal->setProgressComplete(relativeLocalFilePath, status); } else { if (syncOp->affectedNode()->type() == NodeType::Directory) { job = std::make_shared(absoluteLocalFilePath); @@ -642,7 +638,7 @@ bool ExecutorWorker::generateCreateJob(SyncOpPtr syncOp, std::shared_ptraffectedNode()->type() == NodeType::Directory) { _executorExitCode = convertToPlaceholder(relativeLocalFilePath, syncOp->targetSide() == ReplicaSide::Remote, _executorExitCause); - if (_executorExitCode != ExitCode::Unknown) { + if (_executorExitCode != ExitCode::Ok) { LOGW_SYNCPAL_WARN(_logger, L"Failed to convert to placeholder for: " << SyncName2WStr(syncOp->affectedNode()->name()).c_str()); _syncPal->setRestart(true); @@ -669,7 +665,7 @@ bool ExecutorWorker::generateCreateJob(SyncOpPtr syncOp, std::shared_ptraffectedNode()->name()).c_str()); return false;