mirror of
https://github.com/rclone/rclone.git
synced 2026-05-12 18:38:00 -04:00
Before this change when a cache item was in its grace period (with HandleCaching) and the file is reopened, _checkObject runs before the grace timer recovery check. If the remote object's fingerprint changed _checkObject removes the cache file from disk. However the grace recovery path still reused the now-stale fd pointing to a deleted inode, skipping _createFile entirely. This left no cache file on disk, causing cache.Exists() to return false and breaking rename-while-writing logic. Fix this by checking the cache file still exists before reusing the fd in grace recovery. If the file was removed, close the stale fd and downloaders and fall through to _createFile. Also update the fingerprint in item.rename after setting the new object, preventing unnecessary cache invalidation when a file is reopened after a rename. This was discovered in the integration tests on backends that update modtime on rename (like mailru).