Repository navigation
fix(auto-upload): restart folder runs that stay enqueued on rescan - #17805
Open
ToteMeiSter wants to merge 1 commit into
Open
ToteMeiSter wants to merge 1 commit into
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! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).