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 <nilsding@nilsding.org>

[skip ci]
This commit is contained in:
Jyrki Gadinger 2025-10-22 17:18:22 +02:00 committed by backportbot[bot]
parent 4f7cd8fe7e
commit 004b09af90
2 changed files with 18 additions and 3 deletions

View File

@ -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();
}

View File

@ -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,