gscan icon indicating copy to clipboard operation
gscan copied to clipboard

Upload files are not getting deleted.

Open varadekd opened this issue 1 year ago • 5 comments

If an uploaded zip file fails during the scanning phase, we do not remove it from the server storage. This can result in unnecessary space occupation, potentially filling up our server storage.

To reproduce this issue:

  • In your code, ensure that the uploads folder is empty (for easy debugging).
  • Upload a corrupted zip file.
  • You will see an error message in the UI, or if you are checking programmatically.
  • Now, go back to your code and check the upload folder; you will observe the presence of a zip file.

Expectation: This file should be deleted in case of an error since we generate a unique name for the file every time it is uploaded.

Additional Information.

  1. I zipped the gscan code for testing this feature.
  2. Machine information
    1. Machine OS: Ubuntu 22.04 LTS
    2. Node version: v18.18.0
    3. Yarn version: 1.22.21

varadekd avatar Jan 17 '24 11:01 varadekd

@JohnONolan Just wanted to confirm if this is a valid bug. If so I will fix it.

varadekd avatar Jan 17 '24 15:01 varadekd

@JohnONolan Please check the PR created for this issue

varadekd avatar Jan 19 '24 13:01 varadekd

Hey @varadekd, thanks for the issue and PR. Would you be able to create a test to demonstrate the issue, and how the patch resolves it? Thanks!

ErisDS avatar Jan 22 '24 11:01 ErisDS

@ErisDS I can create a test; I just want to make sure that when you say 'create a test to demonstrate the issue,' does this refer to a prefix, a postfix, or both?

My understanding is that it involves a prefix, where we can keep track of exactly what the issue is and how this patch is resolving it.

varadekd avatar Jan 22 '24 12:01 varadekd

@ErisDS Please let me know if my understanding with respect to the requirement is correct or not

varadekd avatar Jan 28 '24 07:01 varadekd