nextcloud / nextcloud/server

[Bug]: API from ShareAPIController sets up the filesystem by path on a per-item base

Open
#58,326 0 comments 0 reactions 1 assignee View on GitHub

@salmart-dev is already working on this.

Since Feb 13, 2026.

1. to develop 33-feedback bug
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

The list of shares "Shared with me" loads very slowly due the amount of DB queries performed.

Steps to reproduce
  1. Have a folder with multiple shares received via Talk
  2. Retrieve the shares "Shared with me"
  3. Check the amount of queries and calls to setupForPath, they will be high
  4. Stack traces point to Root->getFirstNodeByIdInPath being called more than once per share
Image

Note that ShareAPIController::canAccessShare, ShareAPIController::canEditShare and ShareAPIController::canDeleteShare call getFirstNodeByIdInPath, so currently setupForPath gets called multiple times for the same path.

Expected behavior

As few calls to setupForPath are performed to avoid N+1 setups

Nextcloud Server version

master

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps
Enabled:
  - activity: 7.0.0-dev.0
  - bruteforcesettings: 7.0.0-dev.0
  - circles: 34.0.0-dev.0
  - cloud_federation_api: 1.18.0
  - comments: 1.24.0
  - contactsinteraction: 1.15.0
  - dashboard: 7.14.0
  - dav: 1.37.0
  - federatedfilesharing: 1.24.0
  - federation: 1.24.0
  - files: 2.6.0
  - files_pdfviewer: 7.0.0-dev.0
  - files_reminders: 1.7.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - files_versions: 1.27.0
  - lookup_server_connector: 1.22.0
  - notifications: 7.0.0-dev.1
  - oauth2: 1.22.0
  - photos: 7.0.0-dev.0
  - profile: 1.3.0
  - profiler: 5.0.0-dev.0
  - provisioning_api: 1.24.0
  - recommendations: 7.0.0-dev.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - spreed: 24.0.0-dev.1
  - support: 6.0.0-dev.0
  - systemtags: 1.24.0
  - text: 8.0.0-dev.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - updatenotification: 1.24.0
  - user_status: 1.14.0
  - viewer: 7.0.0-dev.0
  - weather_status: 1.14.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - admin_audit: 1.24.0
  - calendar: 6.1.0-dev.0
  - contacts: 8.4.0-dev.0
  - deck: 3.0.0-dev.0
  - encryption: 2.22.0
  - files_accesscontrol: 5.0.0-dev.0
  - files_external: 1.26.0
  - files_lock: 34.0.0-dev.0
  - forms: 5.2.2
  - groupfolders: 22.0.0-dev.0
  - hmr_enabler: 1.3.0-dev.0
  - notes: 4.12.3
  - security_guard: 3.0.0
  - testing: 1.24.0
  - theming_customcss: 1.19.0
  - user_ldap: 1.25.0
  - user_oidc: 8.0.0
  - user_retention: 1.16.0-dev.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.