Skip to content

Quota ignored in backend when uploading files into shared dir (non-public) #5697

Closed

Description

@PVince81

Steps

  1. Create two users, user1 and user2 both with quota 100 MB
  2. Login as user1
  3. Refresh the page (to rule out another known bug)
  4. Upload a 90 MB file.
  5. Create a folder "test"
  6. Share "test" with user2 and make sure to allow editing ("can edit" is checked)
  7. Login as user2
  8. Refresh the page (to rule out another known bug)
  9. Go to "/Shared/test"
  10. Upload a 90 MB file
  11. Refresh the page
  12. Upload another 90 MB file
  13. Repeat 12 many times

If you check the DB, you'll see that the size of the root folder for both users will not change, regardless whether you upload new files or deleted them from the shared dir.

If user2 also has other files, the max upload size might be smaller as is it calculated on the actual quota. Still, you will be able to upload the same file many times as long as that file's size is smaller than the allowed size displayed in the UI.

It looks like this kind of file upload is bypassing the quota stream from lib/private/files/stream/quota.php (CC @icewind1991)

Activity

  1. ghost assigned on Nov 5, 2013
  2. PVince81 commented on Nov 5, 2013

    @PVince81
    ContributorAuthor

    If I login as user1 and force scan using "scanFiles(true)" in the Chrome console, the total file size for the root is correctly updated.

    So there are at least two issues here:

    1. Quota stream must be used when uploading to shared dir
    2. File that lands in another user's storage need to be counted in the total size (the size must propagate to the parent dirs, maybe a quick scan could trigger this)
  3. PVince81 commented on Nov 5, 2013

    @PVince81
    ContributorAuthor

    It looks like the total size is propagated up to the dir under "/Shared" but not up to the root.
    Maybe the logic from Updater::correctFolderSize() can be used, that one updates etags even when crossing storage boundaries. We could try and update the sizes there as well.
    CC @schiesbn

  4. PVince81 commented on Nov 5, 2013

    @PVince81
    ContributorAuthor

    It looks like the watcher from the sharing app is already updating the sizes of the folders, but only up to the user's "/Shared" dir. I'll see whether I can re-route the update to be done directly on the owner's storage/view instead of through the shared storage wrapper.

  5. PVince81 commented on Nov 6, 2013

    @PVince81
    ContributorAuthor

    Here is a list of the issues:

  6. PVince81 commented on Nov 25, 2013

    @PVince81
    ContributorAuthor

    All issues were addressed, closing

  7. locked as resolved and limited conversation to collaborators on Aug 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions