Uploaded Photos are Corrupted (upload chunks from multiple files are blended into each)
- 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. Select a group of photos (and possibly videos) in Samsung's gallery app (I selected between 40mb and 200mb worth)
2. Share with Nextcloud
3. Select folder and upload
4. Select a group of photos (and possibly videos) in Samsung's gallery app (I selected between 40mb and 200mb worth)
5. Share with Nextcloud
6. Select folder and upload
7. (possibly repeat steps again - while the first is still uploading, but I think two simultaneous uploads will do the job).
### Expected behaviour
I expected all files to be in the form they were on the phone. They would be uploaded in chunks of data to permit retries where needed, but reassembled on the server in the form they were originally. Multiple simultaneous uploads (if your app permits this) must not interfere with each other.
### Actual behaviour
It is clear that the files are uploaded in chunks (very sensible), but that the chunks are being mixed up, so the files on the server resemble a blend of a number of the files. A lot of my files (but not all) appear on the server looking like a layered cake, i.e. with stripes of a number of files inside each.
The only solution for this would be to delete them all on the server and reupload (if you've still got the files!)
I imagine having written this process for a different app that you're either not tracking the file ID each chunk pertains to correctly, or you're reusing file IDs between upload processes.
### Android version
11
### Device brand and model
Samsung a20e
### Stock or custom OS?
Stock
### Nextcloud android app version
3.24.2
### Nextcloud server version
26.0.1
### Using a reverse proxy?
Yes
### Android logs
_No response_
### Server error logs
_No response_
### Additional information
I am running Nginx as a reverse proxy (stock and up-to-date Docker image) in front of the nextcloud which runs in a stock Docker image.
Sorry, I don't have logcat installed on the phone so I don't have the logs of this operation that failed.
Contributor guide
Assessment
This issue has not been assessed yet.