Skip to content

Fixed watcher to also update the owner's folder sizes - #5701

Merged
MorrisJobke merged 4 commits into
masterfrom
sharing-updateownerfoldersizes
Nov 11, 2013
Merged

MorrisJobke merged 4 commits into
masterfrom
sharing-updateownerfoldersizes

Conversation

@PVince81

@PVince81 PVince81 commented Nov 5, 2013

Copy link
Copy Markdown
Contributor

This makes sure that when people upload files into someone's directory, the owner's folder's sizes is correctly updated in the DB.

Note that the root folder size is mandatory for quota calculation, which will be needed for the future fix of #5697

Please review @DeepDiver1975 @icewind1991 @schiesbn @karlitschek

Note that the root folder size is mandatory for quota calculation.
@DeepDiver1975

Copy link
Copy Markdown
Contributor

as this touches the very core of owncloud I'd love to see unit tests covering this scenario - thx

@karlitschek

Copy link
Copy Markdown
Contributor

Thanks a lot for looking into that 👍

@PVince81

PVince81 commented Nov 5, 2013

Copy link
Copy Markdown
Contributor Author

Makes sense, I'll add unit tests now that I know that you guys agree with my approach 😄

Vincent Petry added 2 commits November 5, 2013 17:14
- Added base class for sharing unit tests
- Added unit tests for shared files watched to check for folder size
  propagation
@PVince81

PVince81 commented Nov 5, 2013

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 I've added unit tests.
Note that the "big" file change is mostly because I moved the setup/teardown/utility methods to a base class so I could reuse them in the tests for watcher.php.

@PVince81

PVince81 commented Nov 6, 2013

Copy link
Copy Markdown
Contributor Author

I'll have a look into that test failure. Looks like something isn't being cleaned up properly.

@ghost

ghost commented Nov 6, 2013

Copy link
Copy Markdown

@PVince81

PVince81 commented Nov 6, 2013

Copy link
Copy Markdown
Contributor Author

To test this, do the following:

  1. Create user1 and user2, set their quota to 100 MB
  2. As user1, create a dir "test" and share it with user2
  3. Login as user2 and upload a 90MB file into /Shared/test
  4. Login again as user1
  5. Hover on the "Upload" button to see the remaining size

Before the fix, you'd see 100 MB as the root folder size wasn't updated.
After the fix, you should see 10 MB.

@MorrisJobke

Copy link
Copy Markdown
Contributor

👍

MorrisJobke added a commit that referenced this pull request Nov 11, 2013
Fixed watcher to also update the owner's folder sizes
@MorrisJobke
MorrisJobke merged commit 5533147 into master Nov 11, 2013
@MorrisJobke
MorrisJobke deleted the sharing-updateownerfoldersizes branch November 11, 2013 14:16
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants