nextcloud / nextcloud/server

[Bug]: A folder that has both a link share and a file request share only appears in "shared by link"

Open
#53,575 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 32-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

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:

  1. Add a link share to a folder
  2. Add a file request to the same folder
  3. 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-L234

Since 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:

  1. retrieve link/mail shares (mixed with shares that are file request and not)
  2. only the first one is kept (not a file request)
  3. it gets filtered out because not a file request

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.