Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhide discovery logs for file deleted on the server and for discovered file #6112

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,7 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
// Not modified locally (ParentNotChanged)
if (noServerEntry) {
// not on the server: Removed on the server, delete locally
#if !defined QT_NO_DEBUG
qCInfo(lcDisco) << "File" << item->_file << "is not anymore on server. Going to delete it locally.";
#endif
item->_instruction = CSYNC_INSTRUCTION_REMOVE;
item->_direction = SyncFileItem::Down;
} else if (dbEntry._type == ItemTypeVirtualFileDehydration) {
Expand Down Expand Up @@ -1616,7 +1614,16 @@ void ProcessDirectoryJob::processFileFinalize(
item->_direction = _dirItem->_direction;
}

qCDebug(lcDisco) << "Discovered" << item->_file << item->_instruction << item->_direction << item->_type;
{
const auto discoveredItemLog = QStringLiteral("%1 %2 %3 %4").arg(item->_file).arg(item->_instruction).arg(item->_direction).arg(item->_type);
const auto isImportantInstruction = item->_instruction != CSYNC_INSTRUCTION_NONE && item->_instruction != CSYNC_INSTRUCTION_IGNORE
&& item->_instruction != CSYNC_INSTRUCTION_UPDATE_METADATA;
if (isImportantInstruction) {
qCInfo(lcDisco) << discoveredItemLog;
} else {
qCDebug(lcDisco) << discoveredItemLog;
}
}

if (item->isDirectory() && item->_instruction == CSYNC_INSTRUCTION_SYNC)
item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
Expand Down