Skip to content

Commit

Permalink
avoid wrong tracking of renamed folders during discovery
Browse files Browse the repository at this point in the history
ensure server rename operations are tracked as server rename operations

ensure local rename are tracked as local rename operations

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Sep 12, 2024
1 parent 18bb41b commit 092175e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1727,9 +1727,11 @@ void ProcessDirectoryJob::processFileFinalize(
ASSERT(_dirItem && _dirItem->_instruction == CSYNC_INSTRUCTION_RENAME);
// This is because otherwise subitems are not updated! (ideally renaming a directory could
// update the database for all items! See PropagateDirectory::slotSubJobsFinished)
const auto adjustedOriginalPath = _discoveryData->adjustRenamedPath(path._original, SyncFileItem::Down);
Q_UNUSED(adjustedOriginalPath)
_discoveryData->_renamedItemsLocal.insert(path._original, path._target);
if (_dirItem->_direction == SyncFileItem::Direction::Down) {
_discoveryData->_renamedItemsRemote.insert(path._original, path._target);
} else {
_discoveryData->_renamedItemsLocal.insert(path._original, path._target);
}
item->_instruction = CSYNC_INSTRUCTION_RENAME;
item->_renameTarget = path._target;
item->_direction = _dirItem->_direction;
Expand Down

0 comments on commit 092175e

Please sign in to comment.