Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions src/libsync/owncloudpropagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,29 +1091,9 @@ Result<Vfs::ConvertToPlaceholderResult, QString> OwncloudPropagator::staticUpdat

bool OwncloudPropagator::isDelayedUploadItem(const SyncFileItemPtr &item) const
{
const auto checkFileShouldBeEncrypted = [this] (const SyncFileItemPtr &item) -> bool {
const auto path = item->_file;
const auto slashPosition = path.lastIndexOf('/');
const auto parentPath = slashPosition >= 0 ? path.left(slashPosition) : QString();

SyncJournalFileRecord parentRec;
bool ok = _journal->getFileRecord(parentPath, &parentRec);
if (!ok) {
return false;
}

const auto accountPtr = account();
Q_UNUSED(item)

if (!parentRec.isValid() ||
!parentRec.isE2eEncrypted()) {
return false;
}

return true;
};

return account()->capabilities().bulkUpload() && !_scheduleDelayedTasks && !item->isEncrypted() && _syncOptions.minChunkSize() > item->_size
&& !isInBulkUploadBlackList(item->_file) && !checkFileShouldBeEncrypted(item);
return false;
}

void OwncloudPropagator::setScheduleDelayedTasks(bool active)
Expand Down
12 changes: 12 additions & 0 deletions test/testsyncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*/

#include <QtTest>

Check failure on line 8 in test/testsyncengine.cpp

View workflow job for this annotation

GitHub Actions / build

test/testsyncengine.cpp:8:10 [clang-diagnostic-error]

'QtTest' file not found
#include <QTextCodec>

#include "syncenginetestutils.h"
Expand Down Expand Up @@ -150,6 +150,8 @@
}

void testDirUploadWithDelayedAlgorithm() {
QSKIP("bulk upload is disabled");

FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });

Expand Down Expand Up @@ -181,6 +183,8 @@
}

void testDirUploadWithDelayedAlgorithmWithNewChecksum() {
QSKIP("bulk upload is disabled");

FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
fakeFolder.setServerVersion(QStringLiteral("32.0.0"));
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
Expand Down Expand Up @@ -1009,6 +1013,8 @@
*/
void testErrorsWithBulkUpload()
{
QSKIP("bulk upload is disabled");

FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });

Expand Down Expand Up @@ -1104,6 +1110,8 @@
*/
void testNetworkErrorsWithBulkUpload()
{
QSKIP("bulk upload is disabled");

FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });

Expand Down Expand Up @@ -1152,6 +1160,8 @@

void testNetworkErrorsWithSmallerBatchSizes()
{
QSKIP("bulk upload is disabled");

FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });

Expand Down Expand Up @@ -1477,6 +1487,8 @@

void testLocalInvalidMtimeCorrectionBulkUpload()
{
QSKIP("bulk upload is disabled");

const auto INVALID_MTIME = QDateTime::fromSecsSinceEpoch(0);
const auto RECENT_MTIME = QDateTime::fromSecsSinceEpoch(1743004783); // 2025-03-26T16:59:43+0100

Expand Down
Loading