Skip to content

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

Open
@kesselb

Description

@kesselb

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions