Conversation
e2ca636 to
c06435e
Compare
Codecov Report
@@ Coverage Diff @@
## master #35636 +/- ##
============================================
- Coverage 65.68% 65.55% -0.14%
- Complexity 18777 18832 +55
============================================
Files 1222 1230 +8
Lines 70935 71095 +160
Branches 1289 1289
============================================
+ Hits 46597 46603 +6
- Misses 23960 24114 +154
Partials 378 378
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #35636 +/- ##
============================================
+ Coverage 65.77% 65.81% +0.03%
- Complexity 18776 18818 +42
============================================
Files 1222 1228 +6
Lines 70871 70982 +111
Branches 1289 1289
============================================
+ Hits 46617 46716 +99
- Misses 23876 23888 +12
Partials 378 378
Continue to review full report at Codecov.
|
What would the response to a Would the
How can a client implement functionality identical to the The previous PR mentioned a special folder to If not (or alternatively), providing the original location as part of the response to a |
|
@felix-schwarz THX for the feedback - I'll update the description asap. One thing is clear: there is no etag propagation on the trashbin. I agree this would be nice but it is not possible. |
Yes, this solution is much better than the previous PR one, as long as you mean moving the restored file to its previous location when you say "the destination can be anything and anywhere". There should not be a new location for a restored file, but the original one.
What is the purpose of this API? I do not see a usecase in which admin users would like to restore normal user files, unless restore option can be disabled for normal users. It's like if we had
Not sure if this would be needed, a restored file should be moved to its previous location, not anywhere and that location could keep inmutable in local database |
The client has to grab the original location from the webdav property (see the screenshots - which I will update asap). But in addition the api allows to restore the file to any other location - e.g. if there is already a file with the same name living in the original location.
Maybe a bit missleading descrpiption ... |
|
(example curl commands for listing trash items and for restoring have been added to the description) |
|
Thanks for the explanation @DeepDiver1975
I see your point, what I'm used to see when there's already a file with the same name living in the original location is:
Both scenarios end up with the file restored in the same location. The other approach is more flexible for sure but in my opinion doesn't fully fit with the definition for restoring a deleted file. Besides, it would require more effort in the clients since the users would need to choose the new location for the file and if there's a conflict with an existing file there, ask them to keep both or replace. |
c06435e to
dc9f6e1
Compare
|
Changing the Destination in server Side violates the move semantics. |
4cd9834 to
215db92
Compare
butonic
left a comment
There was a problem hiding this comment.
The added flexibility is a bonus:
- clients can show the origin of a deleted file (@deepdiver do we have a path in addition to the parent fileid? the path to the original location might have changed) at the cost of doing the lookup every time they want to restore a file with a MOVE
- the restore target path determination logic moves to the client, which is more more complex to handle, but relieves the server from a lot of special purpose code and simplifies the API because we use a standard MOVE to restore the file, no magic source or target node
trash items have 2 webdav properties for these cases:
Looking at them they seem to have some redundency. {http://owncloud.org/ns}trashbin-original-location might be enough |
215db92 to
123f6bf
Compare
Agreed, what I meant is that using the MOVE operation is fine but it does not necessarily mean that the restore target path needs to be chosen by the final user. I was thinking in this flow:
I think that showing the origin of a deleted file is possible even without the flexibility of letting the user choose the final destination of the file.
In case you want to proceed with the MOVE operation to anywhere, yes, it makes total sense to handle that logic in the client. Just sharing my thoughts, proceed with the solution you consider better 😉 |
|
@davigonz yap, for now the clients should just try to restore to the original folder (id based). If that fails for whatever reason the client can either follow the old implementation and append the In any case, I think this actually makes it easier to control what is happening. The less magic the better. |
8ade5af to
3859f02
Compare
9a08115 to
ca1498d
Compare
2b62937 to
5e78b7e
Compare
individual-it
left a comment
There was a problem hiding this comment.
with the webdav API we should not need And user "user0" has logged in to a web-style session in the tests
| | old | | ||
| | new | | ||
|
|
||
| Scenario Outline: A file deleted from a folder is restored to root if the original folder does not exist |
There was a problem hiding this comment.
why did you had to remove that scenario? Is it not applicable anymore?
There was a problem hiding this comment.
Yes - the behavior of restore changed with the new API. The target location is fully controlled by the clients. There is no need in verifying that under certain situations the file is restore into a different location.
5e78b7e to
252d899
Compare
|
Would it be possible to compute a hash over the largest Then a |
@individual-it I assume this can be done all over the place in all feature files where the trashbin api is used in steps |
@felix-schwarz let me see what I can do .... |
3ccaaa0 to
c0882c3
Compare
butonic
left a comment
There was a problem hiding this comment.
same date format as for getlastmodified.
|
Backport |
Description
We want a WebDAV API as discussed in #15646
This is how it looks like:
Example Requests
Listing trash items
Restoring a file
Related Issue
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: