-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
File ids must stay stable #13310
Comments
Thanks for the summary - let's attack this in OC8.1 |
which is about to explode already ...... |
I wrote some unit tests (in the spirit of "test first") here: #13312 |
Especially case |
@schiesbn is there any situation you can think of when the file id might change if encryption is enabled ? |
Partial fix here: #13385 |
There is no good short term approach for 8.0. Hopefully we can try finding an approach similar to cross storage file renames: #13360 from @icewind1991 I also thought about using rename hooks for the shares and tags, but then it means gathering the list of all files to be renamed in the "pre-rename" hook, then in "post-rename" find out whether the file ids changed, and if yes, update the share and tags tables. But this solution would not solve the case for the sync client anyway and would be have to be thrown away once we implement a proper file-id preserving solution. So, leaving this scheduled to 8.1. @icewind1991 let's discuss the best solution in the coming weeks. |
Yet another situation that can break file ids: whenever a file was moved directly on an external storage. The file scanner might not be able to detect that the file was moved and believe that it is a new file, so it gets an new file id. |
Reason for not detected moves in the clients. |
Why do you guys not use the OS/storage specific identifiers for both FileID and ETags? Just because FileID and ETag are opaque strings does not mean you can not "seed" them with relevant values. CC @ogoffart |
Maybe because not all external storages would support it (ex: SMB) @icewind1991 tried an alternative approach which stores the file id in extended attributes: #14546 |
(which could fall back to the codepath that creates a random/incremental one)
I'd guess every object storage has some way of representing this by IDs or revision numbers or whatever |
So far we seem to have shied away from any solution that would be "local storage specific" or bad/slow/impossible for external storages. Maybe it's time to change ? |
file id's are not determined by the storage backends since they need to be global (and because they are numeric prefixing them isn't trival) |
More broken shares are there: #14084 |
Good news! @icewind1991 has brought a PR that keeps file ids between storages (that includes shared folders): #15360 I also checked master and deleting a file to trashbin then restoring will also keep the file id. 😄 |
Please note that when moving files between external storages (or when deleting from external storage), the fileid is also kept properly, which is nice. (I just tried this and it works 😄) The outstanding issue is only when files are changed remotely (outside of ownCloud). |
"Stable file id" is broken by design for syncing as mentioned in owncloud/client#2725 (comment) |
Here are a few features that rely on file ids:
Currently there are several known situations in which the file id changes:
We need to make the necessary changes in the code to strive and keep the file ids stable.
@DeepDiver1975 @icewind1991 @schiesbn
The text was updated successfully, but these errors were encountered: