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

Activities. Renaming file with file-id gives move activity instead of rename #9744

Closed
Tracked by #9683
Salipa-Gurung opened this issue Aug 6, 2024 · 2 comments
Closed
Tracked by #9683
Assignees
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug

Comments

@Salipa-Gurung
Copy link
Contributor

Describe the bug

  1. Create a file: lorem.txt
  2. Rename a file with file-id
curl -XMOVE 'https://host.docker.internal:9200/dav/spaces/{file-id}' \
-H 'Destination: https://host.docker.internal:9200/dav/spaces/{space-id}/lorem-renamed.txt' \
-uadmin:admin -vk
{
  "message": "{user} moved {resource} to {space}",
}

WIth file path:

curl -XMOVE 'https://host.docker.internal:9200/dav/spaces/{space-id}/lorem.txt' \
-H 'Destination: https://host.docker.internal:9200/dav/spaces/{space-id}/lorem-renamed.txt' \
-uadmin:admin -vk
{
  "message": "{user} renamed {oldResource} to {resource}",
}
@phil-davis
Copy link
Contributor

And what are the definitions/requirements for the words "move" and "rename"?

"MOVE" (an HTTP method) and "mv" (a Linux command line command) are things that "move" where a file is in the file-system hierarchy.

Sometimes the file stays in the same folder, but its name is different. In that case, end-users tend to say that the file has been "renamed".

Sometimes the file goes to another folder, and its name remains the same. I suppose that is "move".

Sometimes the file goes to another folder, and with a different name - that is a "move and rename"?

@kobergj
Copy link
Collaborator

kobergj commented Aug 8, 2024

For the ocis server there is no difference between move and rename. In all manners this is a move to the server.

For user facing notifications (activities/notifications/...) we change the naming so the user isn't confused. We use a simple logic everywhere. If the parent folder stays the same, this is a rename. Everything else is considered a move. So:

Sometimes the file goes to another folder, and with a different name - that is a "move and rename"?

The server would consider this a move, not a rename.

This is also the reason for this bug. Since we address the items by itemID, the path of these items will be empty, hence the server will consider this a rename.

The fix is probably somehow related to #9712. Our events do not contain enough data to reliably reconstruct information from them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug
Projects
Status: Done
Development

No branches or pull requests

6 participants