Offline upload conflicts resolution overwrites the remote file even if the user select to keep both
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### ⚠️ Before posting ⚠️
- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### Steps to reproduce
1. Create a folder
2. Upload a file (e.g. a text file)
3. Go offline (e.g. airplane mode)
4. Change the file (e.g. add some characters)
5. Upload a second time the file
6. Go online
7. A conflict message is shown
8. Choose to keep BOTH files
9. The online file is overwritten by the new uploaded file (only one file present in the folder at the end)
### Expected behaviour
The folder should contain two files: the remote one and the newly uploaded, renamed (as it happens if following the same steps without ever going offline).
### Actual behaviour
The online file is overwritten by the new uploaded file (only one file present in the folder at the end)
### Android version
17
### Device brand and model
Emulator on Android Studio
### Stock or custom OS?
Stock
### Nextcloud android app version
35.0.0 RC1
### Nextcloud server version
Nextcloud Hub 26 Spring (36.0.0 dev)
### Using a reverse proxy?
No
### Android logs
_No response_
### Server error logs
```bash
```
### Additional information
I _think_ it's related to ConflictsResolveActivity having its own flow for offline uploads (see showOfflineOperationConflictDialog()) and passing Decision.KEEP_BOTH_FOLDER instead of KEEP_BOTH to the worker
Contributor guide
Research direction
Start in ConflictsResolveActivity and trace showOfflineOperationConflictDialog() through the offline upload worker, paying attention to the Decision.KEEP_BOTH_FOLDER versus KEEP_BOTH choice. Reproduce the offline conflict flow, then verify that choosing to keep both leaves the remote file and creates a renamed uploaded file, matching the online behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100