fix(auto-upload): skip check - #17401
Conversation
|
APK file: https://github.com/nextcloud/android/actions/runs/30632262721/artifacts/8794164956 |
|
master-IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/17401-IT-master-13-46 |
|
I installed the QA app, logged in, gave permission to manage all files, (disabled auto-upload on stock APK), configured the auto upload of video and photograph in Unplug from charger, plug to my computer, capture logs, go to uploads, pause / play, go to manage auto uploads : I can see my picture and video in the auto-upload configurator, but nothing automatically uploaded yet. Maybe unrelated to your patch, though. Here are the logs : I will use this QA version from now on, I will notice you about uploads or skips when noticed. Thanks for your amazing work, have a good day ! |
dcd461a to
9435327
Compare
|
APK file: https://github.com/nextcloud/android/actions/runs/31084696925/artifacts/8961049995 |
|
Setup:
Test sequence and results:
Conclusion: |
9435327 to
7ed2e0b
Compare
|
APK file: https://github.com/nextcloud/android/actions/runs/31570429137/artifacts/9131278591 |
|
✔️ Hello, I did not notice any missing photo since I installed the first QA apk of this thread. Look promising, thanks for your work ! Looking ahead to become stable. I just installed the last QA apk from this thread, and keep using on a daily basis to keep pictures in sync, I would report any sync issue. |
7ed2e0b to
285f714
Compare
|
blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed. |
|
APK file: https://github.com/nextcloud/android/actions/runs/33478479014/artifacts/9789254211 |
|
@alperozturk96 I spent several hours testing the latest QA APK from this PR and wanted to report the results. Overall, the fix for interrupted/unfinished uploads appears to be working very well, but I also found a reproducible post-reboot auto-upload timing issue that may be separate from this PR. Test setup
Normal background auto-uploadPASS A fresh photo copied into the watched folder was detected and uploaded in approximately 5–10 seconds without manually opening the QA app. I also tested with the phone screen off. Multiple photos successfully uploaded while the device was locked and the QA app was not in the foreground. After leaving the phone idle for approximately 15 minutes, another photo also uploaded successfully with the screen off. Upload timing was somewhat variable. One photo took several minutes, but subsequent photos uploaded normally while the screen remained off. Interrupted upload — network lossPASS I copied a 419 MB video:
I waited until the upload had definitely started, then enabled Airplane Mode to interrupt the transfer. I also accidentally dismissed/swiped away the active Nextcloud upload notification while offline. After approximately 30 seconds I disabled Airplane Mode, did not open the QA app, and waited. Nextcloud later generated a new upload notification automatically and the entire 419 MB video successfully appeared in the remote folder. The QA logs confirm the chunked upload eventually completed with:
So the unfinished-upload/requeue behavior addressed by this PR appears to work correctly in this test. Interrupted upload — full phone rebootPASS I then performed a stronger interruption test using a 400+ MB video:
I copied the video, waited until Nextcloud displayed the active upload notification, and rebooted the phone while the large video was definitely still uploading. After reboot:
The upload recovered automatically and This indicates unfinished-upload recovery also survives a full Android/device reboot. I performed an earlier similar test with a smaller ~100 MB video ( Reproducible issue: new files shortly after reboot can remain pendingI found a separate behavior and reproduced it twice. Controlled reproduction:
I reproduced essentially the same behavior in an earlier reboot test as well: the first post-reboot photo remained pending until another new file was added, at which point both files uploaded. The QA logs appear to match the observed behavior very closely. When I opened the app while the first file was still pending, the log showed:
Later, when the second file was added, the content observer logged:
The logs then show the previously pending This makes it look like the first file is not permanently marked as handled/skipped. Instead, shortly after reboot it can fail to be discovered/processed until a later MediaStore/content-observer event causes another scan. Longer post-reboot testThere is another important detail: this does not appear to remain broken indefinitely after reboot. After leaving the phone running for roughly an hour without continuing the test, I copied:
It uploaded successfully without opening the QA app. Interestingly, that upload was completely silent — there was no Android Nextcloud upload notification at all. I only confirmed it by checking the remote Nextcloud folder. This suggests there may be a post-boot initialization/scheduling race or delay rather than the content observer remaining permanently inactive. Notification behaviorI also found that Android upload notifications are not a reliable indicator of whether auto-upload is actually working. Some successful background/reboot-recovery uploads produced notifications, while others completed completely silently. For testing I therefore verified actual file arrival on the Nextcloud server rather than relying only on Android notifications. SummaryFrom my testing:
Overall, PR #17401 appears to successfully solve the interrupted/unfinished-upload case I was specifically trying to reproduce. The remaining problem seems more related to the post-reboot content observer / auto-upload worker initialization or scan scheduling. I also captured QA logs from these tests. I noticed the exported log contains the account app password in plaintext, so I am intentionally not attaching the raw log publicly. I can provide a redacted version if useful. Thank you for working on this. I hope the detailed reproduction helps. |
Issue
Worker might mark entity as handled but this is not enough worker may get killed and never reached to the actual upload thus oc upload records should be checked as well.
Fixes
#15573