Skip to content

quota API design flaw - unlimited and >1TB can't be detected #879

Description

@AndyScherzinger

Steps to reproduce

  1. set a quota for to 2TB
  2. call /ocs/v1.php/cloud/users/<user>
  3. --> <free>1103360991232</free><used>118102553</used><total>1103479093785</total>
  4. set quota for to 1GB
  5. set a quota for to unlimited
  6. call /ocs/v1.php/cloud/users/<user>
  7. --> <free>1103360991232</free><used>118102553</used><total>1103479093785</total>
  8. set quota for to unlimited
  9. call /ocs/v1.php/cloud/users/<user2>
  10. --> <free>1103356682240</free><used>714783</used><total>1103357397023</total>

Expected behaviour

  1. if I set the quota for a user to 2TB I want this information, right now the quota is always ~1TB, e.g. for 1TB, 2TB, unlimited.
  2. if the quota is set to unlimited I want to get this information so I can detect if the quota for a user is set.
  3. if the quota for all existing users has been set to unlimited I want this information on all users being available (not the ~1TB info again...)

We try to use this for nextcloud/android#204 and obviously want to hide the quota display when none is set, which isn't working because of the described API behavior above.

Actual behavior

1TB, 2TB, Unlimited always set ~1TB in the quota tags...

Server configuration

Operating system:

Web server:

Database:
MySQL

PHP version:
7

Nextcloud version: (see Nextcloud admin page)
9.0.53

Updated from an older Nextcloud/ownCloud or fresh install:
upgrade from 9.0.52

Where did you install Nextcloud from:
Nc website download (zip file)

Signing status:

Signing status

0_o

No errors have been found.

List of activated apps:

App list

NO ACCESS
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

The content of config/config.php:

Config report

$CONFIG = array (
  'instanceid' => ''***',
  'passwordsalt' => ''***',
  'secret' => ''***',
  'trusted_domains' => 
  array (
    0 => '***.net',
  ),
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\Preview\Image',
    1 => 'OC\Preview\MP3',
    2 => 'OC\Preview\TXT',
    3 => 'OC\Preview\Movie',
    4 => 'OC\Preview\MarkDown',
  ),
  'datadirectory' => '/homepages/'***/data',
  'overwrite.cli.url' => ''***',
  'dbtype' => 'mysql',
  'version' => '9.0.52.0',
  'dbname' => ''***',
  'dbhost' => ''***',
  'dbtableprefix' => 'oc_',
  'dbuser' => ''***',
  'dbpassword' => ''***_',
  'logtimezone' => 'UTC',
  'installed' => true,
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'updater.release.channel' => 'stable',
);

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: FF 48.0

Operating system: Win7 Enterprise

Activity

  1. nickvergessen commented on Aug 15, 2016

    @nickvergessen
    Member

    Well quota is a number as well, but it seems to be missing from this endpoint, maybe we can add it as well.

  2. added this to the Nextcloud 11.0 milestone on Aug 15, 2016
  3. AndyScherzinger commented on Aug 15, 2016

    @AndyScherzinger
    MemberAuthor

    @nickvergessen atm it is the parent tag

    <quota>
      <free>1103360991232</free>
      <used>118102553</used>
      <total>1103479093785</total>
    </quota>
    
  4. nickvergessen commented on Aug 15, 2016

    @nickvergessen
    Member

    Yeah, but inside this quota, the following values could exist:

    return [
    'free' => $free,
    'used' => $used,
    'quota' => $quota,
    'total' => $total,
    'relative' => $relative,
    'owner' => $ownerId,
    'ownerDisplayName' => $ownerDisplayName,
    ];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions