Provinite / Provinite/chardb

Implement S3 file deletion in MediaService

Open
#49 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
2h 52m
Merged PRs (30d)
85

Description

Description

The deleteFromS3() method in MediaService currently only logs a warning instead of performing actual S3 cleanup when media files are deleted.

Current Implementation

Located in apps/backend/src/media/media.service.ts:419, the method is a stub that needs to be implemented.

Required Implementation

The TODO outlines the following steps:

  1. Parse the S3 key from the URL
  2. Use AWS S3 client to delete the object(s)
  3. Handle both main image and thumbnail files

Technical Details

  • Method signature: private async deleteFromS3(imageUrl: string, thumbnailUrl?: string)
  • Should handle both main image and optional thumbnail deletion
  • Need to extract S3 keys from URLs and use AWS SDK for deletion
  • Should include proper error handling

Impact

Without this implementation, deleted media files remain in S3 storage, leading to storage bloat and unnecessary costs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/backend/src/media/media.service.ts at MediaService.deleteFromS3() around line 419, then read the TODO and nearby AWS S3 usage. Implement the behavior for the main image and optional thumbnail, including URL-to-key handling and error handling. Done means deleted media no longer leaves those S3 objects behind.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.