Skip to content

Do not use -1 as the size for the root folder of the home storage - #5768

Merged
MorrisJobke merged 3 commits into
masterfrom
quota-workaroundwhenmissingrootsize-home-only
Nov 13, 2013
Merged

MorrisJobke merged 3 commits into
masterfrom
quota-workaroundwhenmissingrootsize-home-only

Conversation

@icewind1991

Copy link
Copy Markdown
Contributor

Replacement of #5684

Same logic only applied to the home storage to prevent sizes of external storages to be shown incorrect

@PVince81

PVince81 commented Nov 8, 2013

Copy link
Copy Markdown
Contributor

I guess it won't work for legacy home storages where the URI is "local:/srv/www/owncloud/data/user1" ?

@PVince81

PVince81 commented Nov 8, 2013

Copy link
Copy Markdown
Contributor

Could we just detect legacy URI's and make them use the new Home storage class ? Might save having to check for both versions when needed.

@ghost

ghost commented Nov 8, 2013

Copy link
Copy Markdown

@PVince81

PVince81 commented Nov 8, 2013

Copy link
Copy Markdown
Contributor

The other problem with this PR is that it will duplicate the code for "calculateFolderSize".
But I don't have a better solution yet.

Maybe we can try and detect whether it's home storage or legacy home storage in the original cache's calculateFolderSize method.

@PVince81

PVince81 commented Nov 8, 2013

Copy link
Copy Markdown
Contributor

For the duplicate code issue, maybe HomeCache can check whether $path === ''. If yes, use the special logic. Else call parent::calculateFolderSize().

@icewind1991

Copy link
Copy Markdown
Contributor Author

I don't want to move the check to the general cache as I would like to keep storage specific code outside the general cache.

the second option sounds sensible

@MorrisJobke

Copy link
Copy Markdown
Contributor

👍

@PVince81

Copy link
Copy Markdown
Contributor

👎 for now as this won't work for legacy storages with URLs like "local:/srv/www/owncloud/data/user1" (when upgrading from 5.0.12)

@MorrisJobke

Copy link
Copy Markdown
Contributor

@PVince81 Can they easiely be migrated to the new storages?

@PVince81

Copy link
Copy Markdown
Contributor

I'm not sure, maybe updating the oc_storages table would do. @icewind1991 ?
If we could migrate them it would save us from having to always check for both cases.

@PVince81

Copy link
Copy Markdown
Contributor

I've made the change for calling the parent method.

Next, I'll look into the home dir migration.

@ghost

ghost commented Nov 12, 2013

Copy link
Copy Markdown

icewind1991 and others added 3 commits November 12, 2013 16:15
Legacy home storage ids with the format "local://path/to/datadir/user1"
are now also wrapped by the HomeStorage.
@PVince81

Copy link
Copy Markdown
Contributor

I've rebased and added a commit for wrapping legacy storage (local://path/to/datadir/username) with the HomeStorage class. This will make it work for users migrated directly from 5.0.12 to OC 6.

Please review @icewind1991 @DeepDiver1975 @kabum

@ghost

ghost commented Nov 12, 2013

Copy link
Copy Markdown

@schiessle

Copy link
Copy Markdown
Contributor

code looks good 👍

@icewind1991

Copy link
Copy Markdown
Contributor Author

👍

MorrisJobke added a commit that referenced this pull request Nov 13, 2013
…tsize-home-only

Do not use -1 as the size for the root folder of the home storage
@MorrisJobke
MorrisJobke merged commit 408ce91 into master Nov 13, 2013
@MorrisJobke
MorrisJobke deleted the quota-workaroundwhenmissingrootsize-home-only branch November 13, 2013 13:57
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 25, 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