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): Update displayname on rename #46474

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jul 12, 2024

Summary

Nextcloud always sets the displayname attribute, with fallback to the basename. So if we move or rename a file the old displayname will still be used as we only update the basename but not the displayname. Safest would be re-fetch, but if displayname and basename is equal we can safe one request and set the displayname to the new basename.

Checklist

@susnux susnux requested a review from skjnldsv as a code owner July 12, 2024 17:30
Nextcloud always sets the `displayname` attribute, with fallback to the basename.
So if we move or rename a file the old displayname will still be used as we only update the basename but not the displayname.
Safest would be refetch, but if displayname and basename is equal we can safe one request and set the displayname to the new basename.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
Copy link
Contributor Author

susnux commented Jul 15, 2024

BTW I am not sure if we should do that here in server or better in the Node class, as this also needs to be updated on move

susnux added a commit to nextcloud-libraries/nextcloud-files that referenced this pull request Jul 15, 2024
The displayname is always set by Nextcloud,
so if it is not a custom one it is set to the basename.
This means on move (and rename) we need to update the displayname.

This is an alternative to nextcloud/server#46474

We should consider making the displayname a top-level attribute like basename.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
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.

None yet

3 participants