Skip to content

feat: add IUserFolder similar to IRootFolder - #53048

Merged
susnux merged 12 commits into
masterfrom
feat/user-folder
Sep 10, 2026
Merged

feat: add IUserFolder similar to IRootFolder#53048
susnux merged 12 commits into
masterfrom
feat/user-folder

Conversation

@susnux

@susnux susnux commented May 22, 2025

Copy link
Copy Markdown
Contributor

Summary

TBD

Checklist

@susnux susnux added this to the Nextcloud 32 milestone May 22, 2025
@susnux susnux added enhancement 3. to review Waiting for reviews labels May 22, 2025
@susnux
susnux force-pushed the feat/user-folder branch from f31e363 to 2013bba Compare May 22, 2025 13:47
Comment thread lib/private/User/User.php Outdated
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
@come-nc come-nc self-assigned this Dec 16, 2025
@come-nc

come-nc commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

I do not understand these last 4 errors and how to get rid of them 😿

There were 4 errors:
1) OCA\Files_Sharing\Tests\ApiTest::testGetShareFromSourceWithReshares
OCP\Files\NotPermittedException: Could not create folder "/test-share-user2", folder exists but unable to get cache entry
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/Folder.php:143
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/Folder.php:501
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyUserFolder.php:50
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:51
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:65
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:206
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:210
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:639
/home/runner/actions-runner/_work/server/server/apps/files_sharing/tests/ApiTest.php:523
2) OCA\Files_Sharing\Tests\ApiTest::testGetShareFromFolderReshares
OCP\Files\NotPermittedException: Could not create folder "/test-share-user2", folder exists but unable to get cache entry
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/Folder.php:143
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/Folder.php:501
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyUserFolder.php:50
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:51
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:65
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:206
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:210
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:639
/home/runner/actions-runner/_work/server/server/apps/files_sharing/tests/ApiTest.php:638
3) OCA\Files_Sharing\Tests\ApiTest::testGetShareMultipleSharedFolder
OCP\Files\NotPermittedException: Could not create folder "/test-share-user2", folder exists but unable to get cache entry
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/Folder.php:[143](https://github.com/nextcloud/server/actions/runs/20283089930/job/58250083307?pr=53048#step:8:144)
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/Folder.php:501
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyUserFolder.php:50
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:51
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:65
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:206
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:210
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:639
/home/runner/actions-runner/_work/server/server/apps/files_sharing/tests/ApiTest.php:825
4) OCA\Files_Sharing\Tests\EtagPropagationTest::testOwnerUnshares
OCP\Files\NotPermittedException: Could not create folder "/test-share-user2", folder exists but unable to get cache entry
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/Folder.php:143
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/Folder.php:501
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyUserFolder.php:50
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:51
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:65
/home/runner/actions-runner/_work/server/server/lib/private/Files/Node/LazyFolder.php:206
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:210
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:1107
/home/runner/actions-runner/_work/server/server/lib/private/Share20/Manager.php:1[147](https://github.com/nextcloud/server/actions/runs/20283089930/job/58250083307?pr=53048#step:8:148)
/home/runner/actions-runner/_work/server/server/apps/files_sharing/tests/EtagPropagationTest.php:275

@blizzz blizzz modified the milestones: Nextcloud 33, Nextcloud 34 Feb 16, 2026
@come-nc
come-nc force-pushed the feat/user-folder branch 2 times, most recently from 9e6edb7 to 9526491 Compare February 26, 2026 10:51
@come-nc
come-nc force-pushed the feat/user-folder branch from 9526491 to a3dfd4c Compare March 5, 2026 15:19
@come-nc

come-nc commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

The remaining failure comes from the fact that when a user folder exists on disk but not in oc_filecache, it fails to be scanned correctly.
This is because of the failsafe in LocalRootScanner the folder is not scanned and this triggers OCP\Files\NotPermittedException: Could not create folder "/test-share-user2", folder exists but unable to get cache entry

Previous code did not have the issue because it did not try to create /user but directly /user/files, I think.
It’s not clear to me whether /user exists in the hierarchy of folders in the node API. It seems previous code passed null as $parent for user folder, but ready the code of getParent that means it will still try to create a node for /user at some point.

@icewind1991 I’m interested by your input on this and whether you think commit d9df76e is a good idea.

@come-nc

come-nc commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

s3 tests are now failing 😭

@come-nc

come-nc commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

I rebased on master and now there are new failures in trashbin tests. I’m unable to reproduce those so far.

@come-nc

come-nc commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

The failure in files_sharing is related to trashbin as well, so the current issue is related to trashbin.
It does not fail on sqlite, somehow.

I could not find a way to reproduce the issue locally.

@susnux susnux removed this from the Nextcloud 34.0.1 milestone Jun 9, 2026
@come-nc
come-nc force-pushed the feat/user-folder branch 2 times, most recently from a63b255 to 52b7207 Compare August 27, 2026 13:16
@susnux

susnux commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

I could not find a way to reproduce the issue locally.

fixed see last commit, this was caused as the trashbin was never unpaused if the error occurred after the pause

@come-nc

come-nc commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

(bumped the version numbers to 36 and rebased on master)

@susnux susnux added this to the Nextcloud 36 milestone Sep 10, 2026
susnux and others added 12 commits September 10, 2026 11:20
* Implements #52896

Similar to the root folder this represents the users home folder,
it allows to group user based methods on the folder like the user quota.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…etUserFolder

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnux merged commit 8781f0b into master Sep 10, 2026
176 checks passed
@susnux
susnux deleted the feat/user-folder branch September 10, 2026 11:09
@susnux

susnux commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

/backport b6e35e0 to stable35

@susnux

susnux commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Documentation: nextcloud/documentation#15605

@susnux susnux removed the pending documentation This pull request needs an associated documentation update label Sep 11, 2026
solracsf added a commit that referenced this pull request Sep 11, 2026
#53048 added an in_array() call without $strict after the
InArrayStrictChecker psalm rule had landed, so static analysis now fails
on every pull request. dirname() always returns a string, so strict
comparison does not change behaviour.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@salmart-dev

Copy link
Copy Markdown
Contributor

Hey @susnux I think there may be an issue with the changes in this PR and the test that is now failing on master seems to have been skipped in the PR (https://github.com/nextcloud/server/actions/runs/34460275752/job/102816738456)

The code was clearing two caches before, while now it is only clearing one, while the others are still in use and get the outdated quota values. Any PR on top of this fails with the same 2 webdav-related.feature tests getting a -3 instead of the right quota.

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

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move getStorageInfo to non-legacy code

8 participants