- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.6k
Description
Bug description
When creating a federated share, the "Allow download and sync" option is ignored and cannot be checked afterwards. When resharing the folder, "Allow download and sync" can be checked in the sharing menu but is not stored (i.e. resets after reloading the page).
If the recipient of the reshare now wants to open a file a message that download is prevented appears ("To view a shared PDF file, the download needs to be allowed for this file share", "This file cannot be displayed as download is disabled by the share" etc.) and the download option is not present. Interestingly this does not affect opening files in Collabora, this still works fine.
This might be related to this issue #48954.
Steps to reproduce
On the server initiating the federated share:
- Establish a mutual federation between two servers
- Share a folder with someone on the other server, ensure "Allow download and sync" is checked, give all permissions (i.e. read, edit, create, delete, share)
- Observe that "Allow download and sync" is unchecked afterwards
- Try to check "Allow download and sync" later, the UI won't allow to check it
On the server receiving the federated share:
5. Accept the incoming share
6. Try opening & downloading some files
7. Reshare the folder to someone else on this server and grant all permissions
8. Observe that the "Allow download and sync" is checked until you reload the page
9. Try re-checking the "Allow download and sync" option, it seems to work until you reload the page
On the account of the reshare recipient:
10. Browse the files of the share, that works fine
11. Try opening a README, a PDF or some other file that can be previewed and be greeted with one of the above messages
12. Try opening a Textdocument in Collabora and observe that you can edit it as expected.
Expected behavior
Checking "Allow download and sync" should allow the user on the other server to preview and download these files.
Nextcloud Server version
30.0.6 on both Servers
1.20, Federation on both Servers
Additional info
I inspected the database on the receiving server and noticed that in oc_share the attributes of the reshare is [["permissions","download",false]].
Executing UPDATE oc_share SET attributes='[["permissions","download",true]]' where id=xxx; solves the issue and also in the UI the "Allow download and sync" is checked. However, as soon as you click the update button in the share menu, the attribute goes back to false.