Skip to content

fix(auto-upload): start auto upload right after resuming global upload pause - #17806

Open
ToteMeiSter wants to merge 1 commit into
nextcloud:masterfrom
ToteMeiSter:fix/auto-upload-start-on-pause-resume
Open

ToteMeiSter wants to merge 1 commit into
nextcloud:masterfrom
ToteMeiSter:fix/auto-upload-start-on-pause-resume

Conversation

@ToteMeiSter

@ToteMeiSter ToteMeiSter commented Oct 12, 2026 •

Copy link
Copy Markdown

Problem

Refs #17576

Since #17632 the global pause on the uploads screen also stops auto upload: AutoUploadWorker checks the pause before it starts and before each file. When the pause is lifted, UploadListMenuProvider.toggleGlobalPause restarts only FileUploadWorker. AutoUploadWorker is not started again, so the synced folders stay idle until the next trigger, usually the periodic AutoUploadRescanWorker. No file is lost, but the upload can wait for the whole period.

Change

When the pause is lifted, toggleGlobalPause calls FilesSyncHelper.startAutoUploadForEnabledSyncedFolders(syncedFolderProvider, backgroundJobManager, overridePowerSaving = false). UploadListFragment passes SyncedFolderProvider and BackgroundJobManager to the menu provider.

Notes

How to test

  • Unit: UploadListMenuProviderTest (resuming global pause starts auto upload of enabled folders without waiting for the rescan) fails without the change (WantedButNotInvoked), passes with it.
  • Device: Checked on a HUAWEI Mate X7 (DEL-LX9, EMUI 15.0.0, Android 12) with a test build: works, auto upload starts right after the global pause is lifted.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The change was drafted with Claude Code (Assisted-by: Claude-Code:claude-opus-5-5).

…d pause

Resuming the global upload pause on the uploads screen only restarted
FileUploadWorker. AutoUploadWorker stops without uploading while the pause
is active, so its folders stayed idle until the next periodic
AutoUploadRescanWorker run.

Start the auto upload of all enabled synced folders when the pause is lifted.
FilesSyncHelper.startAutoUploadForEnabledSyncedFolders is used instead of
startAutoUploadForEnabledSyncedFoldersIfNotActive: the latter calls
isAutoUploadScheduled, which blocks on WorkManager's ListenableFuture, and
this code runs on the main thread from a menu click. The chosen method
enqueues with ExistingWorkPolicy.KEEP when power saving is not overridden, so
a worker that is already running or enqueued is left alone and no upload is
cancelled mid transfer. A worker that stopped because of the pause has
finished, so a new one is enqueued.

Add an injectable FileUploadHelper provider to UploadListMenuProvider so the
menu logic can be unit tested without the application component.

Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
Assisted-by: Claude-Code:claude-opus-5-5
@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...d/ui/fragment/uploadList/UploadListMenuProvider.kt 0.00% 9 Missing ⚠️
...droid/ui/fragment/uploadList/UploadListFragment.kt 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant