Skip to content

fix: preserve link shares on ownership transfer - #64209

Open
salmart-dev wants to merge 3 commits into
masterfrom
fix/transfer-link-shares
Open

fix: preserve link shares on ownership transfer#64209
salmart-dev wants to merge 3 commits into
masterfrom
fix/transfer-link-shares

Conversation

@salmart-dev

@salmart-dev salmart-dev commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes an issue on file ownership transfer, which causes link and email shares to be incorrectly dropped.

Link and email shares get their parent database column set when they come from a reshare, this is used to delete them once the parent share is deleted. During transfer, all shares related to the transferred content are collected and are, in some cases, deleted. The delete triggers the cascade-delete of link and email shares, so they are effectively lost. This PR sets the parent column of the affected shares to null before the main share is deleted, so that the subsequent handling of those shares updates the owner to the user receiving the transfer.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

CommandLine defines both logic to run occ commands in integration tests
as wel as behat steps. This is problematic as if two contexts are loaded
and both need the ability to run occ commands, they will cause a
conflict due to the steps being defined more than once.

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
@salmart-dev salmart-dev self-assigned this Sep 11, 2026
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
@salmart-dev
salmart-dev force-pushed the fix/transfer-link-shares branch from 8a825d4 to a7c6dfb Compare September 11, 2026 11:00
@salmart-dev salmart-dev added this to the Nextcloud 35.0.1 milestone Sep 11, 2026
@salmart-dev salmart-dev added 3. to review Waiting for reviews bug labels Sep 11, 2026
@salmart-dev

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@salmart-dev

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@salmart-dev

Copy link
Copy Markdown
Contributor Author

/backport to stable33

@salmart-dev

Copy link
Copy Markdown
Contributor Author

/backport to stable32

@salmart-dev
salmart-dev marked this pull request as ready for review September 11, 2026 13:40
@salmart-dev
salmart-dev requested a review from a team as a code owner September 11, 2026 13:40
@salmart-dev
salmart-dev requested review from Altahrim, CarlSchwan, leftybournes and provokateurin and removed request for a team September 11, 2026 13:40
@salmart-dev

Copy link
Copy Markdown
Contributor Author

Test failures are unrelated, both should be caused by #53048, the psalm one has already been addressed, but the issue with the non-cleared cache is not yet.

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.

[Bug]: Public shares get deleted after ownership transfer

1 participant