nextcloud / files_lock

GNU Affero General Public License v3.0
24 stars 8 forks source link

Etag doesn't change #57

Closed thisIsTheFoxe closed 2 years ago

thisIsTheFoxe commented 2 years ago

locking/unlocking a file must change its eTag (and get propagated up to root), as otherwise clients will not reload the folder content and thus are not aware of locked state

_Originally posted by @tobiasKaminsky in https://github.com/nextcloud/files_lock/issues/24#issuecomment-736596674_

I found this while debugging. I assume currently locking a file doesn't change its etag?

(lldb) p metadata.fileName
(String) $R0 = "index.html"
(lldb) p metadata.fileName
(String) $R1 = "scan 22-03-15 10-37-49.pdf"
(lldb) p metadata.etag
(String) $R2 = "42e56559fc5322e74d67f60efe8198ba"
(lldb) p result.etag
(String) $R3 = "42e56559fc5322e74d67f60efe8198ba"
(lldb) p result.lock
(Bool) $R4 = false
(lldb) p metadata.lock
(Bool) $R5 = true
juliushaertl commented 2 years ago

Yes, there is currently no ETag change, but should be rather straight forward to propagate a change on lock/unlock. I'll have a look.

juliushaertl commented 2 years ago

Implemented with 3ee9e47 in https://github.com/nextcloud/files_lock/pull/54