Sync refused even though disk space is sufficient
- 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. Have a phone with eg. 32G of free space
2. Sync a 20G folder from Nextcloud to the phone
3. Add a 1G file to the Nextcloud folder
4. For an unknown-to-me reason, the Nextcloud sync did not trigger automatically this time. This is probably another bug, but I'm not sure how to reproduce so let's focus on this one.
5. (Manually) sync the now-21G folder from Nextcloud again
### Expected behaviour
The sync of step 5 should succeed, as the phone will still have 11G of free space after the sync
### Actual behaviour
Nextcloud Android apparently believes that it will need to download 21G of data again, and refuses the sync.
### Android version
12
### Device brand and model
Moto G100
### Stock or custom OS?
Custom (explain in "additional information")
### Nextcloud android app version
3.21.1
### Nextcloud server version
23.0.6
### Using a reverse proxy?
Yes
### Android logs
I have never used logcat below, and given the reproducer I'm not sure logs are useful as the source of the issue should be there: https://github.com/nextcloud/android/blob/cd78151b9435839ebb7e44c672d4b84715581e95/app/src/main/java/com/owncloud/android/utils/FileStorageUtils.java#L665
That said I'm not sure why this code doesn't already work, so if you can't reproduce easily feel free to let me know and I'll look into using logcat!
(A simple fix would be to add a button to the "not enough space" dialog with the option "force sync anyway and see what happens", but I'm not sure you want that given you apparently already included code to properly handle the directory syncing issue)
### Server error logs
```bash
Not relevant
```
### Additional information
LineageOS for Android 12
Contributor guide
Assessment
This issue has not been assessed yet.