Skip to content
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

🐛 Addressed the issue where files in the uploads folder couldn't be deleted in case of an error. #521

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

varadekd
Copy link

Closes #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.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload files are not getting deleted.
1 participant