ocis icon indicating copy to clipboard operation
ocis copied to clipboard

Return id of created folder in mkcol request

Open JammingBen opened this issue 1 year ago • 4 comments

It would be great if webdav mkcol requests could return the id of the newly created folder. A webdav PUT request e.g. returns the file id as a header Oc-Fileid. Can we have the same or similar for mkcols?

This is needed for the web client to immediately fetch a newly created folder when working with id-based requests.

JammingBen avatar Jul 16 '24 10:07 JammingBen

urgh webdav is so sync ... why can't we have nice things like an event stream that clients can listen to to get notified when a file or folder is created... then they could issue a request and show a placleholder until the eventream says "yo! request xyz asked to create a folder. I created it with id yadayada and etag blarg"

at least let us clients tell the server to allow doing this kind of async requests.

oh wait odata already specified how to do that using websockets and Prefer=respond-async.

butonic avatar Jul 19 '24 11:07 butonic

Sounds like a good idea, but needs quite some work, especially on the client side. Also, it would be great if the server was capable of dealing with creating a folder tree structure for an upload. Because currently, the client sends a dozen of mkcol requests before it starts uploading files. Having that async will be painful (I think) because we would need to make sure that the full directory tree has been created before actually stating the upload.

Anyway, can we still get https://github.com/cs3org/reva/pull/4767 merged for now?

JammingBen avatar Jul 22 '24 06:07 JammingBen

why can't we have nice things like an event stream that clients can listen to to get notified when a file or folder is created

We have that. We call it sse.

kobergj avatar Jul 22 '24 10:07 kobergj

What is the issue in just returning the id? Always keep it as simple as possible.

micbar avatar Jul 22 '24 13:07 micbar

It forces the folder creation to be atomic. I'm trying to to get more requests into a CQRS pattern, but that won't happen on webdav. So, we need to update the CS3 API and add mtime and etag properties to the CreateContainer response ... maybe also size, because on posix fs folders have size 4k and not 0. And also for Move, Delete and TouchFile

butonic avatar Oct 02 '24 08:10 butonic