Repository navigation
fix(auto-upload): restart folder runs that stay enqueued on rescan - #17805
ToteMeiSter wants to merge 1 commit into
Conversation
The periodic rescan only cancelled enqueued runs that were periodic, but per-folder runs are one-time work. A run stuck in ENQUEUED stayed "scheduled", so ExistingWorkPolicy.KEEP swallowed every later request for that folder from the content observer, app start and the rescan itself. Cancel every enqueued run except explicit "sync now" runs so the rescan enqueues them again. Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru> Assisted-by: Claude-Code:claude-opus-5-5
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Refs #17439
Problem
Every synced folder has its own one-time
AutoUploadWorkerrun (immediate_files_sync_<id>), enqueued withExistingWorkPolicy.KEEP.isAutoUploadScheduledtreats every unfinished run as active. When a run stays inENQUEUED, every later request for that folder is dropped: the content observer, app start andAutoUploadRescanWorker.AutoUploadRescanWorkercallscancelEnqueuedAutoUploads()to get a clean start, but that function only cancels runs withperiodicityInfo != null. Per-folder runs are one-time work, so nothing is cancelled and the folder stays stuck.Change
cancelEnqueuedAutoUploads()cancels every enqueuedAutoUploadWorkerrun. Runs tagged_ignore_power_saving("sync now") stay, because restarting them would drop the override. The rescan then enqueues the folders again throughstartAutoUploadForEnabledSyncedFoldersIfNotActive.Notes
AutoUploadWorkerruns from older versions are still cancelled, as before.BackgroundJobManagerImpland its test. No file overlap with the other three PRs (fix(auto-upload): start auto upload right after resuming global upload pause #17806, fix(sharing): download file before "Send copy to" #17807, fix(share): send original file instead of cached thumbnail #17808); trial merge of all four is clean.How to test
BackgroundJobManagerImplTest(3 tests: an enqueued folder run is cancelled; running and finished runs are kept; an enqueued "sync now" run is kept). The first test fails without the change (WantedButNotInvoked).🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)
The change was drafted with Claude Code (
Assisted-by: Claude-Code:claude-opus-5-5).