Skip to content

Fix federated reshares#58689

Merged
provokateurin merged 2 commits intomasterfrom
fix/federated-reshare
Mar 12, 2026
Merged

Fix federated reshares#58689
provokateurin merged 2 commits intomasterfrom
fix/federated-reshare

Conversation

@provokateurin
Copy link
Member

The following sharing chain didn't work before:

  1. User A from instances A creates public share link
  2. User B from instance B uses the "Add to your Nextcloud" feature
  3. User B from instance B creates a public share link
  4. User C from instance C uses the "Add to your Nextcloud" feature

Without these fixes step 4 fails:

$this->federatedShareProvider->create($share);
causes $share->setId($shareId); to be called on a share that already has an id set, which fails because it's not allowed. The share from user A to user B is also removed due to bad error handling after the exception.

I'm afraid the PublicOwnerWrapper is broken as well, because the code doesn't consider that the owner might be a user from a different instance, but I'm not sure if that can be fixed at all without huge changes. Maybe this scenario could be detected and the initiator could be used as a replacement, but that could also have other unintended side effects.

@provokateurin provokateurin added this to the Nextcloud 34 milestone Mar 3, 2026
@provokateurin provokateurin requested a review from a team as a code owner March 3, 2026 14:34
@provokateurin provokateurin added bug 3. to review Waiting for reviews labels Mar 3, 2026
@provokateurin provokateurin requested review from Altahrim, come-nc, leftybournes and salmart-dev and removed request for a team March 3, 2026 14:34
@provokateurin provokateurin force-pushed the fix/federated-reshare branch from dd38de7 to d999e97 Compare March 4, 2026 07:51
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @salmart-dev I think. For the rest, approved.

Signed-off-by: provokateurin <kate@provokateurin.de>
…r might on another server

Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurin provokateurin force-pushed the fix/federated-reshare branch from c8fd59c to 5dbbe2c Compare March 12, 2026 09:31
@provokateurin
Copy link
Member Author

Had to rebase due to #57667 adding a test that was failing now.

@provokateurin provokateurin enabled auto-merge March 12, 2026 09:34
@provokateurin provokateurin merged commit ddf7906 into master Mar 12, 2026
187 of 193 checks passed
@provokateurin provokateurin deleted the fix/federated-reshare branch March 12, 2026 11:01
@provokateurin
Copy link
Member Author

/backport to stable33

@provokateurin
Copy link
Member Author

/backport to stable32

@provokateurin
Copy link
Member Author

/backport to stable31

@provokateurin
Copy link
Member Author

/backport to stable30

@backportbot backportbot bot mentioned this pull request Mar 12, 2026
2 tasks
@provokateurin
Copy link
Member Author

/backport to stable29

@backportbot
Copy link

backportbot bot commented Mar 12, 2026

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30

# Create the new backport branch
git checkout -b backport/58689/stable30

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 045ad432 5dbbe2cc

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/58689/stable30

Error: Failed to check for changes with origin/stable30: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot
Copy link

backportbot bot commented Mar 12, 2026

The backport to stable29 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable29
git pull origin stable29

# Create the new backport branch
git checkout -b backport/58689/stable29

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 045ad432 5dbbe2cc

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/58689/stable29

Error: Failed to check for changes with origin/stable29: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

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

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants