Add menu item to force scan files for auto-upload - #17462
Add menu item to force scan files for auto-upload#17462ohthehugemanatee wants to merge 2 commits into
Conversation
Auto upload is only woken by the OS content observer, app start and folder configuration changes; there is no periodic scan job. When the content observer misses a file, nothing ever re-walks the folder and the file stays unuploaded. Add a "Scan for missing files" item to the Auto upload screen overflow menu that starts the auto upload worker for every enabled synced folder with overridePowerSaving set, which bypasses the power-saving and scan interval early exits so the folder is re-walked immediately. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Campbell Vertesi <campbell@vertesi.com>
FilesSyncHelper.startAutoUploadForEnabledSyncedFolders had no coverage. Assert that it starts auto upload only for enabled synced folders and that overridePowerSaving reaches the job manager, which is what the new manual scan action relies on. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Campbell Vertesi <campbell@vertesi.com>
|
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.) |
Demonstration PR to argue for approving #15782 . I commented there that this supports users through a lot of failure modes, and it is trivially easy to implement. This PR is an example of how. Note: I'm a developer, but not for android, so I'm trusting Claude on what's idiomatic here.
When the content observer misses a file for any reason, the file stays unuploaded indefinitely. This PR adds a Manual scan item to the Auto upload screen's overflow menu that calls the existing
FilesSyncHelper.startAutoUploadForEnabledSyncedFolders(..., overridePowerSaving = true)for every enabled synced folder. This is the same code path already exercised byContentObserverWork, so it already respects the pre-existing files config, files withfilesystem.fileSentForUpload = 1, and existing queues.Implementation is 20 lines of adding a menu item to trigger an existing code path with a snack message. But that code path was untested, so I included 43 lines to assert powerSavingOverride and isEnabled filter behavior.
I didn't add a screenshot since I couldn't find anywhere else that tests specific submenu items that way. Existing screenshot tests just include the collapsed menu, so nothing should change.
馃弫 Checklist
/backport to stable-xx.x馃 AI
Generated with Claude Code, signed off by me; both commits carry an
Assisted-by:trailer.