-
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
Restore file from trashbin to a different place overwriting a file #35974
Comments
One guess is that there is some timing of events/callbacks happening when the server is processing a restore from trashbin request, and that restore involves deleting (or overwriting) the target file, and so save-to-trashbin callbacks also get triggered... @micbar @DeepDiver1975 I tried to make sure that this is not an artifact of the test runner. The Webdav Trashbin API will end up in 10.3, so maybe this issue should be looked into, as there might be some underlying behaviour found that can be adjusted/fixed. |
@micbar I added this to the current sprint backlog. Please decide if it is something that should be looked into for 10.3 |
As far as I remember, the restore from trash was designed to work exactly like this. To change the behavior here one just needs to delete the code that keeps user data safe. |
is this using the new API or old API ? did OC behave the same using the old API / old OC version ? |
it was already proposed as an enhancement a while ago and declined. |
Ok, so something to clarify on the requirements side @pmaier1 We could decide to keep the behavior as is for now and document it. |
Note: from run to run of the above scenario I get inconsistent results. I made the test scenario in PR #35948 be "flexible" to allow the 2 observed behaviours. Whatever the desired behaviour, at least it should be consistent. If someone can find how this scenario can always return HTTP (events for trashbin and/or versions going off in not-predictable orders?) |
when I hear "sometimes" I usually hear "race conditions". |
same here - but I get close to 50% split of each result??? |
@phil-davis this reminds me now about another time related component: the file name used when trashing a file contains the current timestamp. If tests run faster there could be timestamp overwrites. |
I assigned myself to investigate test timing. |
As far as I can tell, there is not a test timing issue. https://drone.owncloud.com/owncloud/core/30747/4/13 See #38867 (comment) |
PR #38869 cleans up the "good" scenario so that it only checks for the really-required behavior. That will help for testing the OCIS implementation. And it still gets 50% failures in oC10 core, so it can be used as a test for fixing the problem in oC10. |
PR #38867 demonstrates that the issue is still happening. |
Steps to reproduce
Expected behaviour
Maybe:
files_versions
is enabled), or;(2)
on the end of its name, and the existing file stays, or;Actual behaviour
Sometimes the restore from trashbin overwrites the existing file. When that happens, the existing file is found in the trashbin. I guess that the code-path deletes the existing file (triggering an event that causes it to be saved into the trashbin). And the restored file has the correctly-restored content.
But also sometimes the existing file is not found in the trashbin, and has not been overwritten (it still has the old content). But the API call to restore from trashbin still returns
204
success.Server configuration
Local runs of the above scenario in a development environment on top of current
master
And in drone CI it happens also.
The text was updated successfully, but these errors were encountered: