Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

File Share Quota incorrectly determined for share folders #5817

Closed

Description

@rpocklin

There is a current issue in logic checking if quota && quota.free > 0 in AppBar.vue in order to enable or disable the New + button.

hasFreeSpace() {
return (
!this.quota ||
this.quota.free > 0 ||
(this.currentFolder &&
this.currentFolder.permissions &&
this.currentFolder.permissions.indexOf('M') >= 0) ||
this.publicPage()
)
},

This makes an assumption the user is in his/her personal space (as it looks up the quota returned from the $client.users.getUser(this.user.id) which works well for personal space.

// Load quota
const user = await this.$client.users.getUser(this.user.id)
this.SET_QUOTA(user.quota)

This does not work well for shared folders.

If User A shares a folder 1 with user B, correct me if i'm wrong, but all files added or modified in the folder 1 would relate to User A's quota, not user B (as user A is the owner of folder 1). Currently, if user B is set to have 0B personal quota, the buttons for New + get disabled, even in the shared folder screens as it assumes, since the current user B has no available personal quota, he/she cannot add or upload any more files, even within a shared folder.

Steps to reproduce

  1. Create User A with 0B quota.
  2. Create User B with a quota.
  3. With User B, create a folder 1.
  4. Share folder 1 with User A.
  5. Log in as User A.
  6. Navigate to the share 1.
  7. Verify that User A cannot click the New + button because this user has 0B quota.

Expected behaviour

It should either do a fileInfo call on the currentFolder or similar to ascertain the quota metrics in this share.
I am unsure how to approach a fix to this - there are 4 metrics for the quota (free, relative, used and total).
The application should then call SET_QUOTA with these correct values, relative to the share.

Expected user behaviour is that the user can click on the New + button.

Actual behaviour

The user cannot click on the New + button.

Activity

  1. changed the title [-]File Share Quota mis-reported[/-] [+]File Share Quota incorrectly determined for share folders[/+] on Sep 17, 2021
  2. rpocklin commented on Oct 4, 2021

    @rpocklin
    ContributorAuthor

    Is it possible to get this looked at for comment?

  3. rpocklin commented on Oct 26, 2021

    @rpocklin
    ContributorAuthor

    Any chance for a response on this?

  4. kulmann commented on Oct 28, 2021

    @kulmann
    Contributor

    @pmaier1 could you give a statement regarding the handling of quota please? Then we can figure out a technical solution for this.
    Sorry @rpocklin for keeping you waiting 😞

  5. pmaier1 commented on Oct 29, 2021

    @pmaier1

    @pmaier1 could you give a statement regarding the handling of quota please? Then we can figure out a technical solution for this.

    Well, I absolutely agree with the expected behavior. In the case of a share, User A is using the quota of User B. Consequently, it should not matter at all whether User A has quota or not. Writing into a folder that belongs to User B needs to be possible within the frame of User B's quota.

    Does that answer the question?

  6. kulmann commented on Nov 8, 2021

    @kulmann
    Contributor

    @rpocklin do you want to work on that yourself or should we bring in a PR?

  7. rpocklin commented on Nov 8, 2021

    @rpocklin
    ContributorAuthor

    Hi @kulmann, I'm not confident creating one as I am unsure how to get the relevant metrics of the share info. Let me know if you are able to make a PR for this and I can certainly review / test it.

  8. added
    Type:Bug
    on Jan 27, 2022
  9. AlexAndBear commented on Aug 24, 2022

    @AlexAndBear
    Contributor

    @kulmann @rpocklin
    As far as I can see, we have some problems we need to solve first before we can tackle this:

    1. The backend graph endpoint me/drives doesn't expose the quota of a shared folder
    2. The frontend route files/spaces/shares/ needs to have the storageId as additional parameter
  10. kulmann commented on Aug 24, 2022

    @kulmann
    Contributor

    @kulmann @rpocklin As far as I can see, we have some problems we need to solve first before we can tackle this:

    1. The backend graph endpoint me/drives doesn't expose the quota of a shared folder
    2. The frontend route files/spaces/shares/ needs to have the storageId as additional parameter

    I think in a first iteration we should just disable the quota check inside shared folders. I.e.
    a) if share jail is enabled -> any folder inside the files/spaces/shares route shouldn't have quota checks
    b) if share jail is disabled -> any subfolder of a shared folder shouldn't have quota checks

    Uploads would then just fail with a quota related response from the backend if the quota is exceeded. That's better than never being able to upload into a share (if your own quota is used up).

  11. AlexAndBear commented on Aug 24, 2022

    @AlexAndBear
    Contributor

    @kulmann Maybe we also want to think about discarding the check and disabling the button entirely.
    I think it is an edge case, that the remaining quota space is EXACTLY 0, we also have an quota check while uploading files via uppy.

  12. kulmann commented on Aug 24, 2022

    @kulmann
    Contributor

    @kulmann Maybe we also want to think about discarding the check and disabling the button entirely.
    I think it is an edge case, that the remaining quota space is EXACTLY 0, we also have an quota check while uploading files via uppy.

    Sounds good, let's do that.

  13. AlexAndBear commented on Aug 24, 2022

    @AlexAndBear
    Contributor

    According to my comment:

    The backend graph endpoint me/drives doesn't expose the quota of a shared folder

    I don't think this will be possible, we would likely expose sensitive user information

  14. self-assigned this
    on Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type:Bug

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions