Skip to content

Commit

Permalink
KDESKTOP-1333 - Fix merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementKunz committed Nov 1, 2024
1 parent 9a9d973 commit b3a6fc0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/libsyncengine/jobs/network/getappversionjob.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class GetAppVersionJob : public AbstractNetworkJob {
private:
std::string getSpecificUrl() override;
std::string getContentType(bool &canceled) override;
void setQueryParameters(Poco::URI &, bool &canceled) override { /* no query parameters */}
void setQueryParameters(Poco::URI &, bool &) override { /* no query parameters */ }
ExitInfo setData() override { return ExitCode::Ok; }
bool handleError(std::istream &is, const Poco::URI &uri) override;

Expand Down
42 changes: 19 additions & 23 deletions src/libsyncengine/propagation/executor/executorworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1877,36 +1877,32 @@ ExitInfo ExecutorWorker::propagateConflictToDbAndTree(SyncOpPtr syncOp, bool &pr
case ConflictType::MoveMoveSource: // Name clash conflict pattern
{
if (syncOp->conflict().type() != ConflictType::MoveMoveSource) {
DbNodeId dbId = -1;
bool localNodeFoundInDb = false;
// when it's an Edit-Edit we want to delete the node
NodeId effectiveNodeId =
syncOp->conflict().localNode()->previousId().has_value() ? *syncOp->conflict().localNode()->previousId()
: syncOp->conflict().localNode()->id().has_value() ? *syncOp->conflict().localNode()->id()
: std::string();
_syncPal->_syncDb->dbId(ReplicaSide::Local, effectiveNodeId, dbId, localNodeFoundInDb);
if (localNodeFoundInDb) {
if (ExitInfo exitInfo = deleteFromDb(syncOp->conflict().localNode()); !exitInfo) {
if (const ExitInfo exitInfo = deleteFromDb(syncOp->conflict().localNode()); !exitInfo) {
if (exitInfo.code() == ExitCode::DataError) {
// The node was not found in DB, this ok since we wanted to remove it anyway
LOGW_SYNCPAL_INFO(_logger,
L"Node `" << SyncName2WStr(syncOp->conflict().localNode()->name())
<< L" not found in DB. This is ok since we wanted to remove to anyway.");
} else {
// Remove local node from DB
propagateChange = false;
return exitInfo;
}
}
}
// Remove node from update tree
if (!_syncPal->updateTree(ReplicaSide::Local)->deleteNode(syncOp->conflict().localNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
<< SyncName2WStr(syncOp->conflict().localNode()->name()));
}

// Remove node from update tree
if (!_syncPal->updateTree(ReplicaSide::Local)->deleteNode(syncOp->conflict().localNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
<< SyncName2WStr(syncOp->conflict().localNode()->name()));
}

if (!_syncPal->updateTree(ReplicaSide::Remote)->deleteNode(syncOp->conflict().remoteNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
<< SyncName2WStr(syncOp->conflict().remoteNode()->name()));
}

propagateChange = false;
break;
if (!_syncPal->updateTree(ReplicaSide::Remote)->deleteNode(syncOp->conflict().remoteNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
<< SyncName2WStr(syncOp->conflict().remoteNode()->name()));
}

propagateChange = false;
break;
}
case ConflictType::EditDelete: // Delete conflict pattern
{
Expand Down

0 comments on commit b3a6fc0

Please sign in to comment.