owncloud / owncloud/ocis

d:quota-available-bytes in dprop of PROPFIND give wrong response value

Open
#8,197 3 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## Describe the bug
The WebDaV protocol seems to suggest that d:prop `d:quota-available-bytes` should show the available storage rather than the total spaces.

> The DAV:quota-available-bytes property value is the value in octets representing the amount of additional disk space beyond the current allocation that can be allocated to this resource before further allocations will be refused. It is understood that this space may be consumed by allocations to other resources

However, a simple PROPFIND request using `d:quota-available-bytes` shows the total space allocated for the user and the value doesn't change even if some file is uploaded. The documentation gives different explanation for this:

> Clients should expect that as the DAV:quota-available-bytes on a resource approaches 0, further allocations to that resource may be refused. A value of 0 indicates that users will probably not be able to perform operations that write additional information (e.g., a PUT inside a collection), but may be able to replace through overwrite an existing resource of equal size.

## Steps to reproduce
1. Allocation of quota
Quota allocation for Einstein
```
curl -k -X PATCH 'https://host.docker.internal:9200/graph/v1.0/drives/28dc07c9-6b98-4a60-a860-03fa5b898ffc%244c510ada-c86b-4815-8820-42cdf82c3d51' -u admin:admin --data '{ "quota":{"total":1000000000}}'

```
2. Upload any dummy file.
2. Send a PROPFIND request to get d:prop `d:quota-available-bytes`
```
curl -k -X PROPFIND 'https://host.docker.internal:9200/remote.php/dav/spaces/28dc07c9-6b98-4a60-a860-03fa5b898ffc%244c510ada-c86b-4815-8820-42cdf82c3d51' -u einstein:relativity --data '



'
```
## Expected behavior
The response should show available spaces

## Actual behavior
```


/remote.php/dav/spaces/28dc07c9-6b98-4a60-a860-03fa5b898ffc$4c510ada-c86b-4815-8820-42cdf82c3d51/


1000000000

HTTP/1.1 200 OK

```
Is this supposed to show total spaces or the total spaces allocated by admin to that user?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.