Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Rejecting a Remote Share Is Not Possible with enable_share_accept Enabled #51219

Open
kesselb opened this issue Mar 4, 2025 · 0 comments
Labels
1. to develop Accepted and waiting to be taken care of 29-feedback bug feature: sharing

Comments

@kesselb
Copy link
Contributor

kesselb commented Mar 4, 2025

Bug description

By default, shares are added to a user's home without requiring confirmation. The configuration flag 'sharing.enable_share_accept' changes this behavior, making it necessary to accept shares first. This is managed under Shares → Pending Shares.

In Nextcloud 29, rejecting a remote share with enable_share_accept enabled is not possible.

Steps to reproduce

  1. Have instanceA and instanceB
  2. Set 'sharing.enable_share_accept' => true in the configuration at least for instanceB (this is crucial to reproduce the issue).
  3. Alice (instanceA) shares a folder "Pizza with Pineapple" with Bob (instanceB).
  4. Bob (instanceB) tries to reject the share for obvious reasons. 😉
  5. Bob gets an error message saying the rejection failed—now wondering if the admin has joined the "Pineapple belongs on pizza" team. 🍍🍕
Screencast.From.2025-03-04.11-31-55.webm

Expected behavior

It should be possible to reject a pending share.

Image

Also weird that the share name is shown with }}, even if the original share name did not contain them.

Additional info

The issue appears to be in rejectShareAction.ts, which likely needs an update to handle pending shares differently:

const url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/{id}', {
shareBase: isRemote ? 'remote_shares' : 'shares',
id: node.attributes.id,
})

  • To remove a pending share, the DELETE request should go to: apps/files_sharing/api/v1/{shareBase}/pending/{id} (RemoteController.declineShare)

  • Currently, the DELETE request goes to: apps/files_sharing/api/v1/{shareBase}/{id} (RemoteController.unshare)

The unshare method only works for removing an existing share (one that has already been mounted), not for pending shares.

@kesselb kesselb added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: sharing 29-feedback 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of 29-feedback bug feature: sharing
Projects
None yet
Development

No branches or pull requests

1 participant