Skip to content

Conversation

@come-nc
Copy link
Contributor

@come-nc come-nc commented Mar 20, 2025

Summary

When sharing to a group, it was not respecting the default share folder of each user.
The code was trying to set the target on the group share on creation, while it needs to be done on acceptance for each user, as each user may have a different configuration.

I’m wondering if we should not do the same for user shares as well and only set target when accepting, and also whether it’s expected that we set target for all types of shares. What’s the target for on link shares or share by mail? But maybe it’s needed for federated shares or whatever so I did not remove that.

  • Check if federated shares still end up in the configured folder
  • Check if other share types need it

Checklist

@come-nc come-nc added this to the Nextcloud 32 milestone Mar 20, 2025
@come-nc come-nc self-assigned this Mar 20, 2025
@come-nc come-nc force-pushed the fix/fix-default-share-folder-for-group-shares branch from 5140ae4 to 51e3d97 Compare March 25, 2025 16:37
@ShGKme
Copy link
Contributor

ShGKme commented Apr 14, 2025

/backport to stable28

@ShGKme
Copy link
Contributor

ShGKme commented Apr 23, 2025

/backport! to stable28

@come-nc
Copy link
Contributor Author

come-nc commented Apr 28, 2025

@susnux @icewind1991 @artonge
Pinging you to get feedback on this, what is the correct way to know whether $share->getSharedWith() is a local user or not? If it’s not we cannot call getUserValue with it. Current version filters only IShare::TYPE_USER but I guess there are other share types which targets a local user.

@icewind1991
Copy link
Member

icewind1991 commented Apr 29, 2025

I believe TYPE_USERGROUP, TYPE_GUEST, TYPE_USERROOM and TYPE_DECK_USER are also local users, but that will need to be verified.

Probably makes sense to add a getSharedWithUser(): ?IUser (or similar) to IShare so we only need to have the logic in once place

@come-nc come-nc force-pushed the fix/fix-default-share-folder-for-group-shares branch from 51e3d97 to 373969b Compare May 5, 2025 14:43
@come-nc
Copy link
Contributor Author

come-nc commented May 5, 2025

I believe TYPE_USERGROUP, TYPE_GUEST, TYPE_USERROOM and TYPE_DECK_USER are also local users, but that will need to be verified.

  • TYPE_USERGROUP should only be created by DefaultShareProvider::createUserSpecificGroupShare, so that’s covered.
  • TYPE_USERROOM this one is managed by Talk and does not respect the default share folder on purpose I think
  • TYPE_GUEST: I cannot find any code creating shares with this type, even in the guests application. What is this type used for?
  • TYPE_DECK_USER: Looks like it’s the same as the first two, managed in an application. If deck wants to put the share in the user configured folder, it will need to implement it on its own.

Probably makes sense to add a getSharedWithUser(): ?IUser (or similar) to IShare so we only need to have the logic in once place

That would be cleaner but would make backporting hard, so I would say for now a simple solution is needed.

According to the type list above @icewind1991 , I believe this PR can be reviewed and merged as-is, as the only known type handled by Share20\Manager::createShare to target a user appears to be TYPE_USER.

@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 8, 2025
@come-nc come-nc marked this pull request as ready for review July 8, 2025 11:22
@come-nc come-nc requested a review from a team as a code owner July 8, 2025 11:22
@come-nc come-nc requested review from sorbaugh and removed request for a team July 8, 2025 11:22
come-nc added 2 commits July 8, 2025 13:24
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…eter

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc force-pushed the fix/fix-default-share-folder-for-group-shares branch from 373969b to 7070ba4 Compare July 8, 2025 11:25
@provokateurin provokateurin merged commit 89d659c into master Jul 29, 2025
216 of 225 checks passed
@provokateurin provokateurin deleted the fix/fix-default-share-folder-for-group-shares branch July 29, 2025 09:13
@come-nc
Copy link
Contributor Author

come-nc commented Jul 29, 2025

/backport to stable31

@come-nc
Copy link
Contributor Author

come-nc commented Jul 29, 2025

/backport to stable30

@come-nc
Copy link
Contributor Author

come-nc commented Jul 29, 2025

/backport to stable29

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shares to a local group does not honor the user setting: "Set default folder for accepted shares"

7 participants