Fix conflicts for offline uploads when uploading same file again - #17590
daniele-verducci wants to merge 18 commits into
Conversation
|
@tobiasKaminsky should this be in milestone 35 or 36? |
|
APK file: https://github.com/nextcloud/android/actions/runs/34251212640/artifacts/10066358893 |
7ae46de to
aea7023
Compare
cbe3c19 to
ea79580
Compare
|
Hey @alperozturk96 , as anticipated I fixed also the missing case, so I re-requested your review. You can check just the last 4 (new) commits.
So, the last commits fixes the dialog content and the overwrite. If approved, will close #17589 . Thank you! |
|
/backport to stable-35.0.x |
804d2fd to
57df3dd
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/34466906550/artifacts/10150066862 |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
📱 QA build
The QA build installs alongside a released Nextcloud app, so you can keep Downloading the file requires a GitHub account, so open this link on the |
|
Hey @alperozturk96 , thanks for the review and the suggestion! I applied them, now I wait for the CI to run. |
e2016d8 to
3f492ce
Compare
| val remoteModified = this.modificationTimestamp / MS_IN_SECOND // Unix time in milliseconds | ||
| remoteName == localName && | ||
| remoteSize == localSize && | ||
| remoteCreated == localCreated && |
There was a problem hiding this comment.
How come remoteCreated and localCreated time can be same? We receive the remote file from server then write into our DB.
Scenario 1:
File created from other client, remote creating date written in the server's DB and Android client writes that and compare against the potentially exists local file this can be same file but creating time can be different.
Scenario 2:
File created from Android client does server stores Android's creation time exactly or stores based on server's creation time?
There was a problem hiding this comment.
Good question. Not sure about this, i looked into it with the debugger:
- file created from other client and overwritten by android client while offline: remoteCreated = 0, localCreated = 1789640828
- file created from android client, then re-uploaded while offline: remoteCreated = 1789392966, localCreated = 1789392966
(This is called by createPendingFile, so it's never called if the app is online)
I checked why remoteCreated isn't populated: it is, but it's already 0 in RemoteFile
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
… already uploaded file Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
…g etagOnServer field properly in UploadFileOperation Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
… edge cases Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
…d new name to the one used for online Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
…droid/pull/17590/changes\#r4034298542 Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
Signed-off-by: daniele-verducci <daniele.verducci@nextcloud.com>
19345c5 to
6de6620
Compare
|
stable22-IT test failed, but no output was generated. Maybe a preliminary stage failed. |
|
master-IT test failed, but no output was generated. Maybe a preliminary stage failed. |
|
stable35-IT test failed, but no output was generated. Maybe a preliminary stage failed. |
|
test-Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
Fixes the following two problems:
Conflict message being shown for offline uploads when the offline-uploaded file is the same as the remote
Fixes the conflict message being shown for offline uploads when the offline-uploaded file is the same as the remote. This makes the behavior aligned with what happens online.
How to repro:
Now execute the same actions in a new folder without going offline:
This is because the offline upload erases the etag_on_server field for the already existing db entry.
This PR fixes this issue.
Remote file overwritted by local file when selecting "keep both" after offline upload
This PR does fix this this second issue: #17589
How to repro:
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)