Skip to content

refactor: drop automatic bandwidth calculations and normalize deprecated AutoLimit#9400

Merged
mgallien merged 3 commits intomasterfrom
codex/remove-automatic-bandwidth-limiter
Feb 3, 2026
Merged

refactor: drop automatic bandwidth calculations and normalize deprecated AutoLimit#9400
mgallien merged 3 commits intomasterfrom
codex/remove-automatic-bandwidth-limiter

Conversation

@Rello
Copy link
Collaborator

@Rello Rello commented Jan 30, 2026

Motivation

  • Remove legacy automatic/relative bandwidth throttling logic which is no longer required and simplifies bandwidth handling to absolute limits only.
  • Ensure old/deprecated settings (AutoLimit and LegacyGlobalLimit) are normalized to NoLimit during load and when applied so upgrades don't reintroduce throttling.
  • Stop applying a default 75% automatic throttle and default to unlimited unless a manual limit is set.

Description

  • Remove relative/automatic bandwidth measurement and quota logic from BandwidthManager and simplify its interface/state to handle only absolute upload/download limits (changes in src/libsync/bandwidthmanager.cpp and src/libsync/bandwidthmanager.h).
  • Normalize deprecated auto/legacy settings to unlimited in account handling by persisting normalized values on load and mapping AutoLimit/LegacyGlobalLimit to NoLimit in setters (changes in src/gui/accountmanager.cpp, src/libsync/account.cpp, src/libsync/account.h).
  • Remove the automatic option from the network settings UI and update loadBWLimitSettings()/saveBWLimitSettings() to only expose ManualLimit and NoLimit (changes in src/gui/networksettings.cpp and src/gui/networksettings.ui).
  • Stop defaulting to a 75% automatic throttle in the sync engine by defaulting network limits to unlimited (0) in Folder::setDirtyNetworkLimits() (change in src/gui/folder.cpp).

Testing

  • No automated tests were run for this change.

Codex Task

@Rello Rello self-assigned this Jan 30, 2026
@Rello Rello marked this pull request as draft January 30, 2026 10:57
Copy link
Collaborator

@mgallien mgallien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small comment


private:
// for switching between absolute and relative bw limiting
QTimer _switchingTimer;
Copy link
Collaborator

@mgallien mgallien Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are going to trust the comment, this timer should possibly be removed also

@mgallien mgallien force-pushed the codex/remove-automatic-bandwidth-limiter branch from a6f583a to 44c6a20 Compare January 30, 2026 12:55
@Rello Rello moved this to 🏗️ In progress in 💻 Desktop Clients team Jan 30, 2026
@Rello Rello marked this pull request as ready for review January 30, 2026 21:04
@Rello Rello added this to the 33.0.0 milestone Jan 30, 2026
@Rello
Copy link
Collaborator Author

Rello commented Jan 31, 2026

Before:
Bildschirmfoto 2026-01-31 um 16 56 00

After:

accountmanager.cpp:677 ]: Upload limit setting was set to deprecated auto limit, falling back to unlimited
accountmanager.cpp:688 ]: Download limit setting was set to deprecated auto limit, falling back to unlimited

Bildschirmfoto 2026-01-31 um 19 36 54

Issue:
cfg file has wrong entry:
0\networkDownloadLimit=0
0\networkDownloadLimitSetting=@variant(\0\0\0\x7f\0\0\0\x31OCC::Account::AccountNetworkTransferLimitSetting\0\0\0\0\0)

@Rello
Copy link
Collaborator Author

Rello commented Jan 31, 2026

cfg file written correct now

0\networkUploadLimit=1
0\networkUploadLimitSetting=0

@mgallien mgallien force-pushed the codex/remove-automatic-bandwidth-limiter branch from e1fd5f9 to a2688b2 Compare February 3, 2026 08:46
Rello added 3 commits February 3, 2026 10:15
Signed-off-by: Rello <Rello@users.noreply.github.com>
Signed-off-by: Rello <Rello@users.noreply.github.com>
Signed-off-by: Rello <Rello@users.noreply.github.com>
@mgallien mgallien force-pushed the codex/remove-automatic-bandwidth-limiter branch from a2688b2 to 93295bc Compare February 3, 2026 09:16
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Artifact containing the AppImage: nextcloud-appimage-pr-9400.zip

Digest: sha256:404370d0d326fa33c7519ebaf57b02b699ef28a68ebccabb816034a841051b65

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@mgallien mgallien merged commit a8bdb4f into master Feb 3, 2026
20 of 22 checks passed
@mgallien mgallien deleted the codex/remove-automatic-bandwidth-limiter branch February 3, 2026 10:05
@github-project-automation github-project-automation bot moved this from 🏗️ In progress to ☑️ Done in 💻 Desktop Clients team Feb 3, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
40.0% Coverage on New Code (required ≥ 80%)
E Maintainability Rating on New Code (required ≥ A)
120 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

2 participants