Skip to content

Fix/image leak - #118

Open
vincenttao04 wants to merge 3 commits into
mainfrom
fix/image-leak
Open

vincenttao04 wants to merge 3 commits into
mainfrom
fix/image-leak

Conversation

@vincenttao04

Copy link
Copy Markdown
Contributor

Summary

Sponsor images were never deleted when a sponsor was deleted, leaving orphaned files in S3 and Mongo. This PR fixes that leak and removes some duplicated code.

Changes

  • deleteSponsor cleans up the sponsor's image (S3 object and Mongo record) after confirming the sponsor exists, then deletes the sponsor last, so a cleanup failure leaves everything retryable.
  • Added a shared deleteImagesByTag helper in server/src/util/imageCleanup.ts.
  • Refactored deleteExec to use the shared helper. No behaviour change, the exec-image: tag guard is kept.

Notes

  • Executives already deleted images correctly, so these changes only bring sponsors in line and share the logic.

@vincenttao04
vincenttao04 marked this pull request as ready for review October 21, 2026 14:33
@vincenttao04
vincenttao04 requested a review from RLee64 October 21, 2026 14:33

This branch has not been deployed

No deployments
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.

1 participant