files_primary_s3 icon indicating copy to clipboard operation
files_primary_s3 copied to clipboard

restoring a file from an older version corrupts it.

Open fabio14 opened this issue 8 months ago • 0 comments

Steps to reproduce

  1. setup files_primary_s3 with aws
  2. upload a file (v1). If I download the current version it is fine
  3. Upload a file (v2) and replace the old version. If I download the current version it is fine
  4. Upload a file (v3) and replace the old version. If I download the current version it is fine
  5. restore the v1 file
  6. 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.

fabio14 avatar Jul 03 '24 08:07 fabio14