mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
ensure we do properly failed hydration jobs
report status when the job is in error at end of hydration request instead of doing the opposite properly set status in db when a file failed to hydrate (still a virtual file not a real one) Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
2fc8e5c94c
commit
2a3059d779
2 changed files with 11 additions and 2 deletions
|
@ -229,7 +229,7 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
|
|||
qCritical(lcCfApiWrapper) << "Failed to finalize hydration job for" << path << requestId;
|
||||
}
|
||||
|
||||
if (static_cast<OCC::HydrationJob::Status>(hydrationJobResult) == OCC::HydrationJob::Success) {
|
||||
if (static_cast<OCC::HydrationJob::Status>(hydrationJobResult) != OCC::HydrationJob::Success) {
|
||||
sendTransferError();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -300,7 +300,16 @@ void OCC::HydrationJob::finalize(OCC::VfsCfApi *vfs)
|
|||
return;
|
||||
}
|
||||
|
||||
switch(_status) {
|
||||
case Success:
|
||||
record._type = ItemTypeFile;
|
||||
break;
|
||||
case Error:
|
||||
case Cancelled:
|
||||
record._type = CSyncEnums::ItemTypeVirtualFile;
|
||||
break;
|
||||
};
|
||||
|
||||
// store the actual size of a file that has been decrypted as we will need its actual size when dehydrating it if requested
|
||||
record._fileSize = FileSystem::getSize(localPath() + folderPath());
|
||||
|
||||
|
|
Loading…
Reference in a new issue