Practitionist / Practitionist/elluminar_web
chore: cleanup abandoned UPLOADING MediaAssets (orphaned presigns)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 17h 2m
- Merged PRs (30d)
- 18
Description
From CodeRabbit review on PR #67.
Problem: every requestSubmissionUpload/requestResourceUpload presign creates a MediaAsset row with status UPLOADING. If the browser PUT or finalize fails — or the learner closes the tab — the row stays UPLOADING forever with no storage object behind it.
Proposed fix: scheduled job (fits the existing Netlify scheduled-maintenance cron pattern in netlify/functions/scheduled-maintenance.mjs):
- Find MediaAssets with status UPLOADING older than ~24h.
- Delete any orphaned storage object if one exists (bucket+path).
- Mark rows FAILED/DELETED (MediaStatus enum already has FAILED).
Note: finalize now verifies object existence before READY (PR #67), so these rows are unreachable by submit/attach flows — this is hygiene, not a security gap.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading netlify/functions/scheduled-maintenance.mjs and trace the MediaAsset model, MediaStatus enum, and requestSubmissionUpload/requestResourceUpload flows. Follow the existing scheduled-maintenance pattern to identify UPLOADING rows older than about 24 hours and their bucket and path fields. Done means abandoned rows are cleaned up, any existing orphaned object is handled, and valid uploads remain unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100