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

Skip empty obsolete owner when adding to own NC #25932

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

PVince81
Copy link
Member

@PVince81 PVince81 commented Mar 4, 2021

Description

The owner field is nowadays always empty when adding a federated share
using "Add to your Nextcloud", so don't check for it.

Fixes an issue where "Add to your Nextcloud" doesn't add anything.

I could confirm that the owner is not relevant looking at this code here from the related API: https://github.com/nextcloud/server/blob/bugfix/noid/fix-fed-share-add-to-nc/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php#L184

Issue

Steps to reproduce

  1. Setup two NC instances A and B (I used NC 22 / git master for A and NC 20.0.7.1 for B)
  2. Make sure to set allow_local_remote_servers => true to config.php of both instances
  3. Login to B as admin
  4. Create a folder "add_to_nc"
  5. Share "add_to_nc" with link and copy the link
  6. Open the link
  7. Click the three dots on the top right and pick "Add to your Nextcloud"
  8. Enter the address of A then confirm
  9. Observe the URL and when the "#remote" part appears, try to copy it quickly for further inspection
  10. Wait

Before the fix

No dialog appears, nothing is mounted.

After the fix

A dialog appears and asks you to confirm that you want to mount it.
After confirming, a notification is received later on.
Accepting the notification properly mounts the share

Further information

If you check the "#remote" hash URL part you'll see that "owner" is empty.
The JS code was still expecting the owner to be set, otherwise it would ignore the request.
The fix removes that requirement.

Not sure what NC version stopped setting the owner field in the public link page ?

The owner field is nowadays always empty when adding a federated share
using "Add to your Nextcloud", so don't check for it.

Fixes an issue where "Add to your Nextcloud" doesn't add anything.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
@PVince81
Copy link
Member Author

PVince81 commented Mar 4, 2021

Check for affected versions

  • Source (does it set owner when clicking "Add to NC" ?):
    • master: no
    • stable21: no
    • stable20: no
    • stable19
  • Target (is owner obsolete in that version?):
    • master: yes
    • stable21:
    • stable20:
    • stable19

@PVince81
Copy link
Member Author

PVince81 commented Mar 4, 2021

as far as I can see the owner name would only be set if its visibility is public: https://github.com/nextcloud/server/blob/stable19/apps/files_sharing/lib/Controller/ShareController.php

so having it non-public would break federated shares

@PVince81
Copy link
Member Author

PVince81 commented Mar 4, 2021

/backport to stable21

@PVince81
Copy link
Member Author

PVince81 commented Mar 4, 2021

/backport to stable20

@PVince81
Copy link
Member Author

PVince81 commented Mar 4, 2021

/backport to stable19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants