Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Apr 17, 2024

  • 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

@susnux susnux added this to the Nextcloud 30 milestone Apr 17, 2024
@susnux
Copy link
Contributor Author

susnux commented Apr 17, 2024

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).

@susnux
Copy link
Contributor Author

susnux commented Apr 17, 2024

/backport to stable29

@susnux
Copy link
Contributor Author

susnux commented Apr 17, 2024

/backport to stable28

@susnux
Copy link
Contributor Author

susnux commented Apr 17, 2024

/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>
Copy link
Contributor

@artonge artonge left a comment

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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants