Files
bitvid/tests
thePR0M3TH3ANandClaude Opus 4.8 3aef97f08a feat(edit): clean up superseded thumbnail on edit (orphan removal)
Previously editing a video deleted the old hosted video + its .torrent when the
URL changed, but intentionally left the old thumbnail orphaned in the bucket.
Now that the Edit modal can replace a thumbnail (and we have a clear "thumbnail
changed" signal), also delete the superseded thumbnail: build an orphan list with
the old video ({url}) and/or old thumbnail ({thumbnail}) and pass both to
deleteVideoStorage. Each guarded on old & new being non-empty and different, so we
never delete an object the new note still references. Best-effort; never blocks
the edit.

Tests (collectVideoStorageKeys): a {url} orphan yields the video key + sibling
.torrent; a {thumbnail} orphan yields the thumbnail key; both collect together;
objects under a different publicBaseUrl are never collected (bucket-switch safety).

Also documents the pre-existing uploadModal-reset.test.mjs flake in KNOWN_ISSUES
(reproduced on 1b11cb1b; not from this work).

Build + full lint green; full unit suite green except the documented pre-existing
flake.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-20 09:32:30 -04:00
..
2026-02-21 16:08:33 -05:00
2026-02-21 15:53:09 -05:00