Not enough free space" when uploading: Sometimes wrong freeSpace calculation
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
Somewhere between 20.0.1 and 20.0.9, the calculation of freespace when uploading was changed.
I'm using an app that uploads to not-yet-existing directories, relying on NC creating them implicitely which works fine, unless freeSpace is not calculated (and thus 0) which happens in this case.
Previously, file-upload.js OC.FileUpload.add() would just use the global freeSpace from $('#free_space').val(). Now, freeSpace is initialized as 0, and calculated for some data scenarios. If those scenarios are not met, it will remain 0, failing the upload with "Not enough free space".
freeSpace should be initialized to the global freeSpace as before, and then recalculated for specific situations to make sure freeSpace is valid in all situations.
Issue is still present in NC30.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in file-upload.js at OC.FileUpload.add() and inspect how freeSpace is initialized and how the global value from $('#free_space').val() is used. Reproduce an upload to a not-yet-existing directory, then verify that the upload no longer reports “Not enough free space” when the specific recalculation scenarios are not met.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100