From 842577e014db0f2c7ff734adb49f541d30bce92f Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 15 Nov 2018 10:26:48 +0100 Subject: [PATCH] vfs: Switch order of deletion and journal removal in dehydration To be more crash-resilient. --- src/libsync/propagatedownload.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index a5d87effa..b4607a63b 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -423,8 +423,8 @@ void PropagateDownloadFile::startAfterIsEncryptedIsChecked() // TODO: Could dehydrate without wiping the file entirely auto fn = propagator()->getFilePath(_item->_file); qCDebug(lcPropagateDownload) << "dehydration: wiping base file" << fn; - QFile::remove(fn); propagator()->_journal->deleteFileRecord(_item->_file); + QFile::remove(fn); if (vfs && vfs->mode() == Vfs::WithSuffix) { // Normally new suffix-virtual files already have the suffix included in the path -- 2.30.2