-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload files are not getting deleted. #519
Comments
@JohnONolan Just wanted to confirm if this is a valid bug. If so I will fix it. |
…eleted in case of an error. Closes TryGhost#519 - In the scenario where a user uploaded corrupted files and attempted to scan them using gscan, an error occurred. - Previously, in this scenario, we failed to delete the uploaded file stored locally under the uploads folder. - Issue found: The identified bug was that we were only deleting the file when the promise was successfully resolved, and in the case of an error, we were simply moving to the next middleware. - Issue fixed: To resolve this issue, a finally block has been added to ensure that uploaded files are deleted in any case.
@JohnONolan Please check the PR created for this issue |
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 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. |
@ErisDS Please let me know if my understanding with respect to the requirement is correct or not |
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:
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.
The text was updated successfully, but these errors were encountered: