Skip to content

fix(files): Also restore shares after ownership transfer for object storage - #44904

Merged
susnux merged 1 commit into
masterfrom
fix/transfer-ownership
Apr 18, 2024
Merged

fix(files): Also restore shares after ownership transfer for object storage#44904
susnux merged 1 commit into
masterfrom
fix/transfer-ownership

Conversation

@susnux

Copy link
Copy Markdown
Contributor
  • Resolves:

Summary

When a file is moved between different storages then the file id is not (always) preserved. This means the file id has to be adjusted for all shares.

So in case the file id does not exist anymore we try to find the new file id based on the target path of the transfer and the path suffix of the share.

Checklist

@susnuxsusnux added this to the Nextcloud 30 milestone Apr 17, 2024
@susnux

Copy link
Copy Markdown
ContributorAuthor

Background information:

Currently our file system does not support moving files between storages, so we need to hack this here.
Maybe we can adjust the storage code (especially OCP\Files\Storage\Common::moveFromStorage) so that at least the file ID in the file cache is preserved (idea: swap the rows in the database and then remove the "new" id with the old location).

Comment threadapps/files/lib/Service/OwnershipTransferService.php Fixed
@susnux

Copy link
Copy Markdown
ContributorAuthor

/backport to stable29

@susnux

Copy link
Copy Markdown
ContributorAuthor

/backport to stable28

@susnux

Copy link
Copy Markdown
ContributorAuthor

/backport to stable27

…torage
When a file is moved between different storages then the file id is not (always) preserved.
This means the file id has to be adjusted for all shares.
So in case the file id does not exist anymore we try to find the new file id based on the
target path of the transfer and the path suffix of the share.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnuxforce-pushed the fix/transfer-ownership branch from e2a3144 to 38f4451CompareApril 18, 2024 11:51

@artongeartonge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Band-aid, but should works 👍

Sign up for freeto 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.

5 participants

@susnux@Altahrim@artonge@github-advanced-security@skjnldsv