From 004b09af900fac9ad2b20f09c69dc8d1daea4464 Mon Sep 17 00:00:00 2001 From: Jyrki Gadinger Date: Wed, 22 Oct 2025 17:18:22 +0200 Subject: [PATCH] fix(network): fall back to unlimited bandwidth in case the legacy global limit is still set `-2` used to mean "Use global limits", which no longer exist since 3.17.0. As any negative value results in the auto bandwidth limiter to engage, this could result in unexpected slower sync speeds after a client upgrade. Let's just keep handling that value and assume that we want to use unlimited bandwidth. Fixes #8743 Signed-off-by: Jyrki Gadinger [skip ci] --- src/libsync/account.cpp | 20 +++++++++++++++++--- src/libsync/account.h | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index b957894bfe..2293fd8c75 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -1314,7 +1314,14 @@ void Account::setUploadLimitSetting(const AccountNetworkTransferLimitSetting set return; } - _uploadLimitSetting = setting; + auto targetSetting = setting; + + if (setting == AccountNetworkTransferLimitSetting::LegacyGlobalLimit) { + qCInfo(lcAccount) << "Upload limit setting was requested to be set to the legacy global limit, falling back to unlimited"; + targetSetting = AccountNetworkTransferLimitSetting::NoLimit; + } + + _uploadLimitSetting = targetSetting; emit uploadLimitSettingChanged(); } @@ -1328,8 +1335,15 @@ void Account::setDownloadLimitSetting(const AccountNetworkTransferLimitSetting s if (setting == _downloadLimitSetting) { return; } - - _downloadLimitSetting = setting; + + auto targetSetting = setting; + + if (setting == AccountNetworkTransferLimitSetting::LegacyGlobalLimit) { + qCInfo(lcAccount) << "Download limit setting was requested to be set to the legacy global limit, falling back to unlimited"; + targetSetting = AccountNetworkTransferLimitSetting::NoLimit; + } + + _downloadLimitSetting = targetSetting; emit downloadLimitSettingChanged(); } diff --git a/src/libsync/account.h b/src/libsync/account.h index 0e1b38d8cd..9746f24934 100644 --- a/src/libsync/account.h +++ b/src/libsync/account.h @@ -98,6 +98,7 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject public: enum class AccountNetworkTransferLimitSetting { + LegacyGlobalLimit = -2, // Until 3.17.0 a value of -2 was interpreted as "Use global network settings", it's now used to fall back to "No limit". See also GH#8743 AutoLimit = -1, // Value under 0 is interpreted as auto in general NoLimit, ManualLimit,