mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
New Disco algortihm: Fix TestChunkingNG::connectionDroppedBeforeEtagRecieved
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
parent
710934bdbd
commit
370923791d
2 changed files with 4 additions and 1 deletions
|
@ -669,6 +669,7 @@ void ProcessDirectoryJob::processFile(PathTuple path,
|
||||||
if (up._valid && up._contentChecksum == remoteChecksumHeader) {
|
if (up._valid && up._contentChecksum == remoteChecksumHeader) {
|
||||||
// Solve the conflict into an upload, or nothing
|
// Solve the conflict into an upload, or nothing
|
||||||
item->_instruction = up._modtime == localEntry.modtime ? CSYNC_INSTRUCTION_UPDATE_METADATA : CSYNC_INSTRUCTION_SYNC;
|
item->_instruction = up._modtime == localEntry.modtime ? CSYNC_INSTRUCTION_UPDATE_METADATA : CSYNC_INSTRUCTION_SYNC;
|
||||||
|
item->_direction = SyncFileItem::Up;
|
||||||
|
|
||||||
// Update the etag and other server metadata in the journal already
|
// Update the etag and other server metadata in the journal already
|
||||||
// (We can't use a typical CSYNC_INSTRUCTION_UPDATE_METADATA because
|
// (We can't use a typical CSYNC_INSTRUCTION_UPDATE_METADATA because
|
||||||
|
@ -687,6 +688,7 @@ void ProcessDirectoryJob::processFile(PathTuple path,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
item->_instruction = CSYNC_INSTRUCTION_CONFLICT;
|
item->_instruction = CSYNC_INSTRUCTION_CONFLICT;
|
||||||
|
item->_direction = SyncFileItem::None;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If the size or mtime is different, it's definitely a conflict.
|
// If the size or mtime is different, it's definitely a conflict.
|
||||||
|
@ -701,9 +703,9 @@ void ProcessDirectoryJob::processFile(PathTuple path,
|
||||||
// sizes and mtimes pops up when the local database is lost for
|
// sizes and mtimes pops up when the local database is lost for
|
||||||
// whatever reason.
|
// whatever reason.
|
||||||
item->_instruction = isConflict ? CSYNC_INSTRUCTION_CONFLICT : CSYNC_INSTRUCTION_UPDATE_METADATA;
|
item->_instruction = isConflict ? CSYNC_INSTRUCTION_CONFLICT : CSYNC_INSTRUCTION_UPDATE_METADATA;
|
||||||
|
item->_direction = isConflict ? SyncFileItem::None : SyncFileItem::Down;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item->_direction = item->_instruction == CSYNC_INSTRUCTION_CONFLICT ? SyncFileItem::None : SyncFileItem::Down;
|
|
||||||
if (dbEntry._type == ItemTypeVirtualFile)
|
if (dbEntry._type == ItemTypeVirtualFile)
|
||||||
item->_type = ItemTypeVirtualFileDownload;
|
item->_type = ItemTypeVirtualFileDownload;
|
||||||
if (item->_file.endsWith(_discoveryData->_syncOptions._virtualFileSuffix)) {
|
if (item->_file.endsWith(_discoveryData->_syncOptions._virtualFileSuffix)) {
|
||||||
|
|
|
@ -418,6 +418,7 @@ void PropagateUploadFileCommon::slotStartUpload(const QByteArray &transmissionCh
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 fileSize = FileSystem::getSize(fullFilePath);
|
quint64 fileSize = FileSystem::getSize(fullFilePath);
|
||||||
|
_item->_size = fileSize;
|
||||||
_fileToUpload._size = fileSize;
|
_fileToUpload._size = fileSize;
|
||||||
|
|
||||||
// But skip the file if the mtime is too close to 'now'!
|
// But skip the file if the mtime is too close to 'now'!
|
||||||
|
|
Loading…
Reference in a new issue