Skip to content

fix(auto-upload): file detection#16459

Open
alperozturk96 wants to merge 6 commits intomasterfrom
fix/auto-upload-file-detection
Open

fix(auto-upload): file detection#16459
alperozturk96 wants to merge 6 commits intomasterfrom
fix/auto-upload-file-detection

Conversation

@alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Feb 6, 2026

  • Tests written, or not not needed

Changes

The upload operation only requires read access to the file channel. Exclusive locking is unnecessary and can cause LOCK_FAILED errors when multiple uploads are triggered for the same local path. This change allows concurrent read access.

When a local file is detected as not eligible for auto-upload, both the auto-upload entity and the corresponding upload entity are removed from the database before continuing.

The upload file operation uses a remote existence check to determine whether a sync conflict has occurred. However, this approach is not accurate when the exact same file already exists on the remote; in such cases, there is no need to block the upload or throw an errors.

How to reproduce?

  1. Configure auto-upload for the same local path with different remote destinations.
  2. Trigger auto-upload for both configurations simultaneously.
  3. One of the uploads may fail with a LOCK_FAILED error.

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96 alperozturk96 force-pushed the fix/auto-upload-file-detection branch from 543535b to 7a8e90a Compare February 6, 2026 12:29
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16459.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Codacy

SpotBugs

CategoryBaseNew
Bad practice4242
Correctness7474
Dodgy code257257
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3434
Performance4345
Security1818
Total478480

SpotBugs increased!

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