Skip to content

fix(conflict-resolve) check#17302

Open
alperozturk96 wants to merge 3 commits into
masterfrom
fix/is-same-file-on-remote
Open

fix(conflict-resolve) check#17302
alperozturk96 wants to merge 3 commits into
masterfrom
fix/is-same-file-on-remote

Conversation

@alperozturk96

Copy link
Copy Markdown
Collaborator

Issue

Successful file uploads was showing conflict resolution notification.

How to reproduce?

  1. Create a custom auto upload configuration
  2. Use a voice recorder app to record audio files to the chosen custom folder

Changes

  • Unifies usage of isSameFileOnRemote
  • Adds eTag for OCUpload for eTag comparison against newly fetched RemoteFile. OCFile cannot be used because eTag field of OCFile not consistent and gets updated from multiple places. eTag of OCUpload only gets updated from one place.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/28873642851/artifacts/8142093477
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/101.json
#	app/src/main/java/com/nextcloud/client/database/NextcloudDatabase.kt
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96
alperozturk96 force-pushed the fix/is-same-file-on-remote branch from 1a5365d to 7e57102 Compare July 15, 2026 11:52
@github-actions

Copy link
Copy Markdown

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

return false
}

private fun isETagUnchangedSinceLastUpload(remoteFile: RemoteFile, localPath: String, remotePath: String): Boolean {

@alperozturk96 alperozturk96 Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isSameFileOnRemote collision check relied only on RemoteFile.isSame() (size + creation/modification timestamps + image dimensions), which is not reliable.

I added an etag column to OCUpload, written once at upload success UploadFileOperation copies file.getEtag() from the post-upload and never mutated afterward.

The etag of the OCFile is not stable it is always mutated from somewhere else and causing issue to compare.

For example A.jpg uploaded before I must have eTag and eTagOnServer value but when I check database eTag field is empty. I need simple comparison eTag is changed or not.

Image

@tobiasKaminsky CC

@github-actions

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3232
Correctness6666
Dodgy code213213
Experimental11
Malicious code vulnerability22
Multithreaded correctness2929
Performance4141
Security1919
Total403403

@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/29413156394/artifacts/8344807494
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@github-actions

Copy link
Copy Markdown

@tobiasKaminsky tobiasKaminsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us first try to find out why etag on ocfile is empty.

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.

2 participants