[Bug]: A folder that has both a link share and a file request share only appears in "shared by link"
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
If a folder has both a link share and a file request associated with it, on the left menu, under "Shares", it will only show up in the "Shared by link" category, and not also in "File requests".
Steps to reproduce
Repro video. Invisible cursor but hopefully easy enough to follow.
If you dislike videos:
- Add a link share to a folder
- Add a file request to the same folder
- Look in the "Shares" -> "File requests" folder/group/category in the menu on the left: it is absent
(Not an order of operations thing, it's the same result whichever you do first. Link supersedes file request.)
Expected behavior
The share should appear in both places if both things apply to it.
Nextcloud Server version
master
Operating system
None
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
Also present on NC30, backports would be nice.
Notes from relevant expert, maybe pretty straightforward to fix:
I suspect the fact that we merge and delete duplicates to be the root cause
https://github.com/nextcloud/server/blob/11594df79913f5f821e8d6a70066744246a2e5f5/apps/files_sharing/src/services/SharingService.ts#L230-L234Since we filter out file requests here: https://github.com/nextcloud/server/blob/baeff572326dbb54c06925da7ad7a8d03cfd8bb1/apps/files_sharing/src/files_views/shares.ts#L118
Then the logic would do:
- retrieve link/mail shares (mixed with shares that are file request and not)
- only the first one is kept (not a file request)
- it gets filtered out because not a file request
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading apps/files_sharing/src/services/SharingService.ts around the duplicate-merging logic and apps/files_sharing/src/files_views/shares.ts around the file-request filter. Reproduce the case with both a link share and a file request on one folder, then verify the folder appears in both Shared by link and File requests without losing either share.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100