Skip to content

Commit 638ac78

Browse files
authored
Merge pull request #8140 from nextcloud/bugfix/disableBulkUpload
disable use of bulk upload for small files
2 parents 180095c + 690f751 commit 638ac78

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed

src/libsync/owncloudpropagator.cpp

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,29 +1091,9 @@ Result<Vfs::ConvertToPlaceholderResult, QString> OwncloudPropagator::staticUpdat
10911091

10921092
bool OwncloudPropagator::isDelayedUploadItem(const SyncFileItemPtr &item) const
10931093
{
1094-
const auto checkFileShouldBeEncrypted = [this] (const SyncFileItemPtr &item) -> bool {
1095-
const auto path = item->_file;
1096-
const auto slashPosition = path.lastIndexOf('/');
1097-
const auto parentPath = slashPosition >= 0 ? path.left(slashPosition) : QString();
1098-
1099-
SyncJournalFileRecord parentRec;
1100-
bool ok = _journal->getFileRecord(parentPath, &parentRec);
1101-
if (!ok) {
1102-
return false;
1103-
}
1104-
1105-
const auto accountPtr = account();
1094+
Q_UNUSED(item)
11061095

1107-
if (!parentRec.isValid() ||
1108-
!parentRec.isE2eEncrypted()) {
1109-
return false;
1110-
}
1111-
1112-
return true;
1113-
};
1114-
1115-
return account()->capabilities().bulkUpload() && !_scheduleDelayedTasks && !item->isEncrypted() && _syncOptions.minChunkSize() > item->_size
1116-
&& !isInBulkUploadBlackList(item->_file) && !checkFileShouldBeEncrypted(item);
1096+
return false;
11171097
}
11181098

11191099
void OwncloudPropagator::setScheduleDelayedTasks(bool active)

test/testsyncengine.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ private slots:
150150
}
151151

152152
void testDirUploadWithDelayedAlgorithm() {
153+
QSKIP("bulk upload is disabled");
154+
153155
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
154156
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
155157

@@ -181,6 +183,8 @@ private slots:
181183
}
182184

183185
void testDirUploadWithDelayedAlgorithmWithNewChecksum() {
186+
QSKIP("bulk upload is disabled");
187+
184188
FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
185189
fakeFolder.setServerVersion(QStringLiteral("32.0.0"));
186190
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
@@ -1009,6 +1013,8 @@ private slots:
10091013
*/
10101014
void testErrorsWithBulkUpload()
10111015
{
1016+
QSKIP("bulk upload is disabled");
1017+
10121018
FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
10131019
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
10141020

@@ -1104,6 +1110,8 @@ private slots:
11041110
*/
11051111
void testNetworkErrorsWithBulkUpload()
11061112
{
1113+
QSKIP("bulk upload is disabled");
1114+
11071115
FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
11081116
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
11091117

@@ -1152,6 +1160,8 @@ private slots:
11521160

11531161
void testNetworkErrorsWithSmallerBatchSizes()
11541162
{
1163+
QSKIP("bulk upload is disabled");
1164+
11551165
FakeFolder fakeFolder{ FileInfo::A12_B12_C12_S12() };
11561166
fakeFolder.syncEngine().account()->setCapabilities({ { "dav", QVariantMap{ {"bulkupload", "1.0"} } } });
11571167

@@ -1477,6 +1487,8 @@ private slots:
14771487

14781488
void testLocalInvalidMtimeCorrectionBulkUpload()
14791489
{
1490+
QSKIP("bulk upload is disabled");
1491+
14801492
const auto INVALID_MTIME = QDateTime::fromSecsSinceEpoch(0);
14811493
const auto RECENT_MTIME = QDateTime::fromSecsSinceEpoch(1743004783); // 2025-03-26T16:59:43+0100
14821494

0 commit comments

Comments
 (0)