files_primary_s3
files_primary_s3 copied to clipboard
restoring a file from an older version corrupts it.
Steps to reproduce
- setup files_primary_s3 with aws
- upload a file (v1). If I download the current version it is fine
- Upload a file (v2) and replace the old version. If I download the current version it is fine
- Upload a file (v3) and replace the old version. If I download the current version it is fine
- restore the v1 file
- download the file
Exected result
v1 file
Actual Result
Partial V1 file or no file.
Note
The binaries on AWS are all fine, and previous versions can all be downloaded correctly from OWC.
Additional Information
While debugging, I noticed that the reference to the file in the oc_filecache table is not updated. Specifically, when a file is restored, all data from the last uploaded version, including the size, remains unchanged, and the record for the current version is not updated. Thus, when restoring the file to version v1, I still see the data for v3 in the database.
If I manually force the correct size with an sql update, I have no problems downloading the file correctly.