reva icon indicating copy to clipboard operation
reva copied to clipboard

feat: add folder id and etag to dav mkcol responses

Open JammingBen opened this issue 1 year ago • 7 comments

Adds the OC-FileId and the OC-ETag headers to dav mkcol responses.

This is necessary for clients that work with ids and want to fetch a folder immediately after creating.

fixes https://github.com/owncloud/ocis/issues/9618

JammingBen avatar Jul 17 '24 08:07 JammingBen

I'm not sure this is the correct approach. We would need another stat call, which will impact performance. We should pass the id with the grpc responses so we don't have to call it again. This needs some refactoring, but I still prefer it over the extra stat call.

kobergj avatar Jul 22 '24 10:07 kobergj

I'm not sure this is the correct approach. We would need another stat call, which will impact performance. We should pass the id with the grpc responses so we don't have to call it again. This needs some refactoring, but I still prefer it over the extra stat call.

Sounds reasonable, could you give me a hint where to start for this? :) Or will this be a more complicated task...?

JammingBen avatar Jul 22 '24 11:07 JammingBen

We can use an opaque property for now

micbar avatar Jul 22 '24 13:07 micbar

Unfortunately not so easy :cry:

The decomposedfs method CreateDir does not return anything, hence it cannot return the id: https://github.com/cs3org/reva/blob/edge/pkg/storage/utils/decomposedfs/decomposedfs.go#L682

We would need to change the interface and adjust all other implementations.

kobergj avatar Jul 22 '24 13:07 kobergj

Argh ok. Then I'm afraid this is a bit too much for me currently, especially since I don't know how to test all these storage drivers.

JammingBen avatar Jul 23 '24 05:07 JammingBen

Just for the records: We have the same issue with Move, Delete and TouchFile. All of them do not return anything and therefore need extra calls to get their id (or similar values)

kobergj avatar Jul 23 '24 07:07 kobergj

@micbar will you do your IDE magic for the refactor? I volunteer to review it. (Though I'll probably regret that :wink: )

kobergj avatar Jul 25 '24 08:07 kobergj