server icon indicating copy to clipboard operation
server copied to clipboard

fix(files): Correctly copy the cache information on copy operations

Open artonge opened this issue 1 year ago • 1 comments

Needed to copy the encrypted flag of encrypted files when those files are two level down in a moved folder.

Reproduction steps of the issue:

  • Set up the following folder structure
    • /A/B/t.txt
    • /C
  • Copy A in C
  • t.txt is encrypted but does not have the encrypted flag set to true, and therefore not readable.

With this PR, t.txt is readable.

Note: Open to better ways to share code between the two methods.

artonge avatar Oct 10 '24 16:10 artonge

This might help with #48174.

joshtrichards avatar Oct 10 '24 18:10 joshtrichards

Snap, the ObjectStoreStorage does the cache copy inside the storage copy, so the final cache copy creates another filecache entry.

https://github.com/nextcloud/server/blob/6a0e11783f6fc921a1e6569f72b6dd864d6189cc/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L699-L700

Edit: maybe this part can be improved: https://github.com/nextcloud/server/blob/6a0e11783f6fc921a1e6569f72b6dd864d6189cc/lib/private/Files/Cache/Updater.php#L203-L206

artonge avatar Oct 15 '24 15:10 artonge

This introduced a regression for some cross-storage moves, see https://github.com/nextcloud/server/pull/49695

icewind1991 avatar Dec 06 '24 16:12 icewind1991

hello, was this backported to 29/30? Would you mind helping me with the links?

kyteinsky avatar Jan 20 '25 23:01 kyteinsky

hello, was this backported to 29/30? Would you mind helping me with the links?

No, it was not.

joshtrichards avatar Jan 21 '25 13:01 joshtrichards

/backport to stable30

nfebe avatar Feb 13 '25 23:02 nfebe

/backport to stable29

nfebe avatar Feb 13 '25 23:02 nfebe